How do I optimize WordPress websites?

Today I was optimizing the performance of a WordPress website, which I do with all the websites I develop. The steps involve are very simple.

Here I am writing all the steps one may need during optimization:

  1. First of all check the website on Google PageSpeed, google will provide rating to your website out of 100. Note down the numbers in Mobile and Desktop versions and follow the steps below.
  2. Google will also give suggestions under Possible Optimizations. You can pick one by one and resolve them. First one in my case was Server Response Time. The best way to increase the server response time is installing a caching plugin. I tried few plugins and finalized “WP Super Cache”. There can be other factors as well like a slow shared server you can check if caching doesn’t bring you under 1 sec, you should check your server as well. Ideally your page should open in 3 secs.
  3. Next was Render Blocking Scripts – When we try to include JS file in HTML head tag browser try to load them first then start rendering page. We should always move our <script> tags at the end of body(just before body end tag).
  4. Leverage browser caching – for this I found a very simple fix just put below code in your .htaccess file and you are done.
    <IfModule mod_expires.c>
    ExpiresActive on
    <FilesMatch "\.(gif|jpeg|jpg|png|ico|js|css|swf|svg)$">
    ExpiresDefault "access plus 10 days"

    You can modify time and file extensions.
  5. Optimize Images – The simplest and easiest method is to download the images, css and JS from the link given the last of google page speed report. You will get all the resources in a zip file. Get all the files and replace where ever possible.
  6. Minify CSS/JS – Using the above files you can solve this issue as well.

Once you are done with all above points, your website should reach above 80 points in mobile as well as Desktop. If not get a professional’s help hop over to this site.

Share this post