WordPress performance optimization best practices?


I am trying to improve my page speed. I have optimized images on my site. Now I am working on JavaScript rendering above the fold.

With your personal experience, what is your preference or best practice?
Using a plugin like Autoptimize or W3 Total Cache?
Adding Async or Defer attribute to the tags?
Adding JavaScript to the footer?

In advance, thank you for sharing your experience.

WordPress performance optimization best practices
in progress 0
Ali Akkas 2 months 2 Answers 0

Answers ( 2 )

  1. Use a light theme (Astra, GeneratePress etc) + good hosting + optimize on-page (compress images, don’t upload video directly on the website, not install many plugins, have wprocket or total cache, update to the newest version of WordPress, themes and installed plugins, split pages of the long post or long comment into smaller pages, etc).

  2. Each installation is a specific case, What you do and use on installation could be totally different than what you do and use on another installation. It all depends on your specific case. Maybe if you share the URL you could have better suggestions.
    Autoptimize is a good option. Also, you should also consider sucuri.
    When you’re using Autooptimize you cannot use async or defer because it combines and compresses all of your javascript. But some are needed to populate above the fold.
    If you really do want to do it. You’ll have to see which ones you do need for above the fold and remove them from autoptimize and then others you can async and autoptimize. I use Autoptimize, combined with it’s whitelist filter to combine only the scripts, present on every page. Then I move all inline scripts to files and add defer to all scripts with a filter. All this requres manual work, especislly deciding which scripts to whitelist for combining, but it has worked pretty well for me.
    Don’t use W3 Total Cache. Using Async / Defer can mess things up I have found. All JS should be in the footer and properly registered. Use a CDN like Cloudflare or sucuri. Also if you have a huge amount of images – Cloudinary is really good.
    So use an optimization plugin along with a CDN for the best results. Sucuri WAF is a good choice as it gives you security along with the CDN caching.

Leave an answer

Choose from here the video type.

Put here the video id : https://www.youtube.com/watch?v=sdUUx5FdySs Ex: 'sdUUx5FdySs'.

What is the capital of USA? ( Washington )