WordPress Speed Optimization Guide

  Introduction
The load speed of your website is essential, you need a fast site because slow sites annoy users, meaning less visitors to your site. Secondly, search engines also consider the speed of your site when generating their rankings. There are a number of factors influencing the load speed of a WordPress site, so in this post we will examine the top 5 factors that affect WP site load speed.
WP Mayor’s work is supported by its audience. If you purchase through a link on our website, we may earn a commission. Here’s why you can trust us.
Table of contents

The load speed of your website is essential, you need a fast site because slow sites annoy users, meaning less visitors to your site. Secondly, search engines also consider the speed of your site when generating their rankings. There are a number of factors influencing the load speed of a WordPress site, so we will examine the top 5 factors that affect WP site load speed:

1. Hosting Provider

All the optimization in the world won’t save your site unless it is hosted on a good server. If your site attracts thousands of visitors you might want to check out a Content Delivery Network (CDN), else just try to stick to quality hosting which has a good uptime and powerful hardware. If you are interested in setting up a VPS for your WordPress site, check our setting up a VPS guide. You can have a good indication of how fast your site is by taking the speed test here. Compare the results with your competition and see whether you need to improve your performance. Once we have a good dedicated server we can take the next step of examining the actual size of the pages we are loading.

2. Page Size

Pages on your website consist of several elements such as images, JavaScript, CSS, flash and video. Adding up the size of all these elements will give you a total number of KB that needs to be loaded by the browser in order to view the page. So we need to reduce this as much as possible in order to save on bandwidth. We can compare this to pouring water into a funnel and into a cup. A funnel has as a specific limit of water it can pass through at any time. Thus by reducing the amount of water we are pouring in, the whole action is completed earlier.

To examine the size of the different elements used on your page you can use Firebug together with YSlow, both Firefox plugins, so you need that browser too if you’re not already using it. WP Smush.it is a WordPress plugin that automatically compresses the images inserted in your pages or posts, thus minimising the total size of the site’s pages.

Another tip for reducing page size is selective loading of files such as plugin JS and CSS. For example, if you are using a contact form plugin and only use the contact form on the ‘Contact’ page, there is no use for loading the plugin’s JS and CSS files on every page of your site. You can therefore use WordPress conditionals to only load the files required by the contact form plugin on the ‘Contact’ page. Unfortunately, at present not many plugins offer the option of selective loading, however you can still use selective loading of your own files, for example, if I am using a JS animation on only one particular page, I would use WordPress conditionals e.g. if ( is_home() ) to only load it for that page.

Finally, you should also follow the common practice of loading CSS files at the beginning of the page and JavaScript files at the end of the page (when possible). CSS is needed for the look of the page and is therefore loaded first, but JS is usually more bandwidth-intensive and concerns the behavior of the page, thus can be loaded later. Ideally, your page size should be below 50KB.

Tools used: Firebug, YSlow, WP Smush.it

3. Number of Database Requests

A WordPress site should not be making more than circa 25 queries to load any page on your site. So try to keep the number below that. If you observe too many queries being made, start by checking whether any plugin in particular is making many queries, unfortunately, some plugins are not perfectly designed and can burden your site with many unnecessary requests. If any such plugins are found it would be a good idea to email the plugin author or fix them yourselves if you are comfortable with code wrangling. Until the issues are fixed remove the offending plugin, if you lack coding skills and the plugin author does not respond, try to search for an alternative plugin.

A handy tool to use is P3 Plugin Performance Profiler. This plugin creates a profile of your WordPress site’s plugins’ performance by measuring their impact on your site’s load time.  Oftentimes, WordPress sites load slowly because of poorly configured plugins or because there are so many of them. By using the P3 plugin, you can narrow down anything causing slowness on your site.

Tools used: Debug Queries, P3 Plugin Performance Profiler

4. Database Optimisation

Over time, your WordPress database can generate what’s called ‘overhead’. This condition is similar to a defragmented hard drive. Fortunately, plugins exist that take care of fixing this automatically. Both WP Database Optimizer and WP-DBManager do a good job, most importantly allowing you to schedule automatic maintenance and optimization of your WP database.

WP-Optimize gives you even more features, including the ability to delete post revisions or spam comments. This can be a good plugin to run once in a while, unfortunately, it doesn’t have any scheduling functionality. Why would you delete post revisions, you may ask. Well, as an example, if you have a post that is approximately 100KB data and you have 5 revisions of that post, the total space wasted is about 500KB. And if you have 100 posts similar to it, you have 50MB of database space wasted. We don’t want that, hence the need to clean post revisions every now and then. I usually run this plugin once a year or so.  This article on WPMU.org expands more on the topic of WP database optimization and repair.

Tools used: WP Database OptimizerWP-DBManager

5. Caching and Minifying

A good caching and optimizing plugin is essential to give a good boost to your WordPress site speed. The best WordPress caching plugin at the moment is W3 Total Cache. I’ve regularly shaved seconds off the loading time of WP sites after implementing this plugin. It could for example cut your load time from 3 seconds to half a second when implemented correctly. WPBeginner run an excellent tutorial on setting up W3 Total Cache.

Tools used: W3 Total Cache

Conclusion

Implementing the suggestions above should put you well on your way to having a very optimized WordPress website. Use the speed test mentioned in this post to evaluate the success of your efforts, testing your site after implementing the recommendations illustrated in each of the 5 points above.

Also make sure to check our post about WordPress System Monitoring Plugins, which will help you understand if you have any issues with your WP installation.

Hope this guide is helpful, and if you have any more WordPress optimization tips which I’ve missed, you are welcome to let me know in the comments section.

Jean Galea
Jean Galea
Jean Galea is an investor, entrepreneur, and blogger. He is the founder of WP Mayor, the plugins WP RSS Aggregator and Spotlight, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.
Jean Galea
Jean Galea
Jean Galea is an investor, entrepreneur, and blogger. He is the founder of WP Mayor, the plugins WP RSS Aggregator and Spotlight, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.
PeachPay for WooCommece

An all-in-one checkout and payment solution for WooCommerce . See your store's sales increase by 35%!

4 Months FREE with WP Engine

4 months free on all shared managed WordPress and eCommerce hosting plans. Offer ends on 12/01/2022.

Expand your toolset with expertly verified solutions delivered to your inbox every week.
Join thousands of designers, developers, and marketers who trust our experts to find and test the best tools for their WordPress sites.
By signing up to our newsletter, you agree to receive electronic communications from WP Mayor that may include advertisements.
Expand your toolset with expertly verified solutions delivered to your inbox every week.
Join thousands of designers, developers, and marketers who trust our experts to find and test the best tools for their WordPress sites.​
By signing up to our newsletter, you agree to receive electronic communications from WP Mayor that may include advertisements.

40 Responses

  1. Hi Jean

    I was literally looking for WordPress Optimization article and my friend suggested yours

    thanks a tons for posting such Detailed Post,

    and you know the best part? you have added all the necessary links to help visitors

    thanks 🙂

  2. What is the ideal number of plugins one must install so that website speed is not affected?

  3. when I add Google AdSense ads on my blog. it’s going very slow. like- in mobile 85 to 30. then how to solve this problem. and another thing is custom https redirects. how to solve it. please reply.

  4. Hi Jean Galea,
    Thanks for this great article.
    Does the Akismet plugin decreases the speed of website?.

    1. Hi Vikash,
      all plugins have acquired some space. So Its totally dependent on your hosting plan. If your hosting is good then it’s not affected, but if your hosting is not good then your site will definitely go slow.

  5. its wonderful article and very helpful for increasing the speed of website but one question in mind does using the plugin more reduce website speed

  6. Does the Akismet plugin increase database size? Well, in your very best way, for the optimization.
    Thanks

  7. These steps are right to increase WordPress website page speed thank you for share this article.

  8. HI Galea,

    Does the Akismet plugin increase database size? Well, in your very best way, for the optimization.
    Thanks

  9. I’ve started building more complex WP sites recently – and they’ve begun to slow down. This post is a godsend – and enough in itself to get mt to subscribe to your RSS feed.

    Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *

From web hosting to WooCommerce plugins and backup services, we have put together a collection of exclusive coupons and deals just for you.
WP Mayor_Icon_white
2022 Reader Survey