Wordpress speed optimization
Want to SPEED UP WordPress?

Well then you've come to the right place.

To generate leads, you need to be visible online so make sure your page speed is up to snuff.

Once your loading times are world class... you'll see it a rise in leads, conversions & search engine rankings.

Here are 43 free WordPress optimizations to speed up your site!

How to Speed Up Your WordPress Site (Ultimate 2020 Guide)

If your site takes too long to load, most people are gone, lost before you even had a chance.

Not only that, but Google now includes site speed in it’s ranking algorithm.

That means that your site’s speed effects SEO, so if your site is slow, you’re now losing visitors from impatience and reduced rankings in search engines.


Let’s fix that.

How To Speed Up WordPress

As a side note, these are not ordered by importance or any criteria, I’ve just gathered everything I’ve learned around how to speed up WordPress page loads and listed them all here.

I guarantee that using even a few will help speed up your site.

1. Start with a solid theme/framework

You might be surprised to here this, but the Twenty Nineteen “framework” (aka the default WP theme) is lightweight and quite speedy.

That’s because they keep the “guts” simple; compare that to bloated frameworks which have tons of features that you will never use, slowing your site to a crawl.

From my experience, the fastest loading premium frameworks are definitely the Thesis & Genesis Frameworks. The drawbacks are that they require coding skills and they're expensive.

I currently use the Acabado Theme from Income School. It surpasses all other WordPress themes by being far easier to use, and lightning fast.

Without ads, my mobile pagespeed score is 98. And my desktop score is 100! (I am using BlueHost).

My PageSpeed Perfect Score of 100

Acabado is an incredibly solid theme that won’t slow you down with excess plugins or bloat, hoorah!

2. Use an effective caching plugin

WordPress plugins are obviously quite useful, but some of the best fall under the caching category, as they drastically improve page loads time, and best of all, all of them on are free and easy to use.

By far my favorite, bar none, is W3 Total Cache.

I wouldn’t recommend or use any other free caching plugin, it has all of the features you need and is extremely easy to install and use.

Simply install and activate, and what your page load faster as elements are cached.

4. Use a content delivery network (CDN)

All of your favorite big blogs are making use of this, and if you are into online marketing using WordPress (as I’m sure many of my readers are) you won’t be surprised to here that some of your favorite blogs like Copyblogger are making use of CDN’s.

Essentially, a CDN, or content delivery network, takes all your static files you’ve got on your site (CSS, Javascript and images etc) and lets visitors download them as fast as possible by serving the files on servers as close to them as possible.

I personally use the free CloudFlare CDN Content Delivery Network on my WordPress site, as I’ve found that their dashboard is very simple to use (and comes with video tutorials for setting it up, takes only a few minutes).

There is a paid CDN called StackPath which is one of the most popular and highly regarded CDNs in the world. Their plans start from $10/month.

5. Optimize images (automatically)

Optimizing every image on your site would be beyond a pain, and incredibly time consuming.

Fortunately, there is an amazing, free plugin called EWWW Image Optimizer which will do this process to all of your images automatically, as you are uploading them. No reason not to install this one.

There is a paid automatic image optimizer called ShortPixel Image Optimizer which I have used on my WordPress site. The cost is $9.

EWWW works better than ShortPixel on my site.

6. Optimize your homepage to load quickly

This isn’t one thing but really a few easy things that you can do to ensure that your homepage loads quickly, which probably is the most important part of your site because people will be landing there the most often.

Things that you can do include:
  • Show excerpts instead of full posts
  • Reduce the number of posts on the page (I like showing between 5-7)
  • Remove unnecessary sharing widgets from the home page (include them only in posts)
  • Remove inactive plugins and widgets that you don’t need
  • Keep in minimal! Readers are here for content, not 8,000 widgets on the homepage
Overall, a clean and focused homepage design will help your page not only look good, but load quicker as well.

7. Optimize your WordPress database

I’m certainly getting a lot of use out of the word “optimize” in this post!

This can be done the very tedious, extremly boring manual fashion, or…

You can simply use the WP-Optimize plugin, which I run on my site.

This plugin lets you do just one simple task: optimize the your database (spam, post revisions, drafts, tables, etc.) to reduce their overhead.

8. Disable hotlinking and leeching of your content

Hotlinking is a form of bandwidth “theft” that slows down your site when other sites link to the images on your site from their articles.

Disabling hotlinking is an advanced technique that requires some coding skills. See the FAQ section at the end of this post for step-by-step instructions.

Another option is a great free little plugin called Prevent Content Theft. There are no settings, simply install and you’re good to go.

9. Add an expires header to static resources

An Expires header is a way to specify a time far enough in the future so that the clients (browsers) don’t have to re-fetch any static content (such as css file, javascript, images etc).

This way can cut your load time significantly for your regular users.

You need to copy and paste the following code in your root .htaccess file:
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
The above numbers are set for a month (in seconds), you can change them as you wish.

10. Adjust Gravatar images

Some blogs go as far to disable gravatar images throughout the site, and for everyone.

It will benefit your site speed if you set the default image (found in “Discussion”, under the settings tab in the WordPress dashboard) to a blank space rather than a default image.

11. Add LazyLoad to your images

LazyLoad is the process of having only only the images above the fold load (i.e. only the images visible in the visitor’s browser window), then, when reader scrolls down, the other images begin to load, just before they come into view.

This will not only speed you page loads, it can also save bandwidth by loading less data for users who don’t scroll all the way down on your pages.

To do this automatically, install the jQuery Image Lazy Load plugin.

12. Control the amount of post revisions stored

WordPress, left to its own devices, would store every single one of your post revisions, indefinitely.

Now, when this post is done and published, why would I need all of those drafts stored?

That’s why I use the Optimize Database after Deleting Revisions plugin. No need to clutter your backend with unnecessary amounts of drafted posts.

13. Turn off pingbacks and trackbacks

By default, WordPress interacts with other blogs that are equipped with pingbacks and trackbacks.

Every time another blog mentions you, it notifies your site, which in turn updates data on the post. Turning this off will not destroy the backlinks to your site, just the setting that generates a lot of work for your site.

Fortunately, disabling both on your own site is simple. In your WordPress dashboard, navigate to Settings > Discussion:

Here, you’ll want to deselect (uncheck) the first two options bellow:

  • Attempt to notify any blogs linked to from the article
  • Allow link notifications from other blogs (pingbacks and trackbacks) on new articles
This will prevent your site from creating and receiving pingbacks and trackbacks

14. Replace PHP with static HTML, when necessary

This one is a little bit advanced, but can drastically cut down your load time if you are desperate to include page load speeds, so I included it.

I’d be doing this great post injustice if I didn’t link to it for this topic, as it taught me how to easily do this myself, in a few minutes.

So go there and check it out, it wrote it out in plainer terms than I ever could!

15. Use CloudFlare

This is similar to the section above on using CDN’s. To put it bluntly, CloudFlare, along with the W3 Total Cache plugin discussed above, are a really potent combination (they integrate with each other) that will greatly improve not only the speed, but the security of your site.

Both are free!


By default, WordPress displays the full content of each article on your homepage and archives which slows down your site.

How To Fix It: Navigate your WordPress admin area Settings » Reading in your WordPress dashboard and select “For each article in a feed, show: Summary” instead of “Full Text.”


This saves resources and also will keep you compliant with Google Pagespeed’s guidelines.


Posts with a lot of comments tend to be really really slow.Sometimes posts with a lot comments return a blank screen because it exhausts their memory.We strongly recommend that you paginate your comments.

How To Fix It:
  • Login to your WordPress admin area and go to Settings » Discussions.
  • Next look at the section where it says Break comments into pages. Simply select the number of comments you want on each page, and how you want to display them.
Once you do this, based on your theme styling, either you will see a numeric pagination or you will see Previous / Next comment links.


WordPress is now including an additional javascript file  wp-emoji-release.min.js?ver=4.3.1  in your header for emoji support. This creates an unnecessary additional HTTP request, especially if you don’t want to even use them.

HOW TO FIX IT: Install the free WordPress plugin “Disable Emojis” by Ryan Hellyer. This plugin disables the new emoji functionality in WordPress 4.2.


If you don’t want the overhead of another plugin then simply take the code from Ryan’s plugin and drop it into the bottom of your functions.php file.


The Gonzalez plugin lets you disable unnecessary scripts from loading on a page-level and site-wide basis. You will most likely be able to get rid of at least 5 or more HTTP requests/scripts by using this plugin.
  • It isn’t free, but well for the money if you are trying to squeeze out a little more speed.
  • For example, Contact Form 7 and social plugins by default load scripts on every page. With this plugin, you can easily only load scripts on certain pages.


If you are using the native WordPress commenting system by default it creates a separate HTTP request for each gravatar.

If you have a lot of comments this can result in tons of requests and unnecessary redirects.

HOW TO FIX IT: Install the free WordPress plugin WP User Avatar. This In the settings menu click on “Disable Gravatar and use only local avatars.” Then choose a default avatar.


WordPress automatically loads  wp-embed.min.js which allows easy embedding of videos, images, tweets, etc.

A lot of people don’t use this feature. You can always link the original way by grabbing the embed code off of YouTube or Twitter. The issue is that the script loads on every page. There are a couple of ways to disable this script.

HOW TO FIX IT: Install the free WordPress plugin “Disable Embeds


Change your PHP version to the latest version and your website will be a lot snappier.

  • Step #1. Make sure your plugins and themes are compatible with newer PHP versions with the PHP Compatibility Checker before updating to the latest version of PHP.
  • Step #2. Change your PHP Version in cPanel
    1. Log into cPanel.
    2. Click PHP Configuration in the Software section. ...
    3. Select the version of PHP you want to use from the dropdown.
    4. Click Update to save your php configuration.
If you only see PHP Version (not Select PHP Version) in the Software/Services section, your server does not support this feature. You should contact customer support at your web host and request that they upgrade you directly.

Some web hosts do not give you the ability to change PHP versions on your own, in that case you may need to submit a support ticket in order to request an upgrade.

Note that If you encounter any issues, you can also easily switch back to your original PHP version.
Why do only 15% of WordPress users use the latest PHP version? Even though it makes your site faster?

Your hosting company will NOT automatically upgrade you to the latest version of PHP since your theme/plugins may not be compatible (and they don’t want to break your site).

This means you need to do it yourself or request help from your host). It also means if you’ve been on the same host for many years and have never done it, you’re probably still running and old version of PHP.

One of the goals of the WordPress organization is that all users upgrade to PHP 7 (or the most current version).


  • For faster site speed you should keep your WordPress site, theme, and plugins updated to the latest versions.
  • Not doing this will make your site slow, unreliable, and vulnerable to security threats.

All you need to do is visit Dashboard » Updates page and install those updates. This is a one-click process.

As a website owner, it’s your responsibility to keep your WordPress site, theme, and plugins updated to the latest versions. Not doing so may make your site slow and unreliable, and make you vulnerable to security threats.

As a well maintained open source project, WordPress is updated frequently. Each update will not only offer new features, but also fix security issues and bugs. Your WordPress theme and plugins may have regular updates, too.

Update WordPress core, theme, plugins, and framework if you use one (eg. Genesis).

WordPress developers are always trying to make things faster. Each new release comes with several performance improvements that makes WordPress run faster and more efficient.

For example, WordPress 4.2 improved JS performance for navigation menus, and WordPress 4.1 improved complex queries which helped with performance of sites using those queries.

Since speed is a huge factor in SEO, you should definitely keep your WordPress updated to ensure maximum performance benefits.

Since many website owners do not login to their WordPress dashboard daily, they may not even know that there is an update available for days. Thankfully, you have a few options.

Get Email Notifications for Updates in WordPress
When you’re busy running your business, logging into your site to check for updates is usually the last thing on your mind.

Wouldn’t it be easier if you could get an email notification whenever there is an update on your WordPress sites?

Well that’s possible.

First thing you need to do is install and activate the WP Updates Notifier plugin. Upon activation, visit Settings » Updates Notifier to configure the plugin settings.

Auto Install WordPress Updates

You can automate the process even further. WordPress allows you to enable automatic updates for major releases, plugins, and themes.

This option is risky if you’re not using managed WordPress hosting. Managed WordPress hosting companies automatically update your site to major WordPress versions and keep an eye out if something breaks.

If you turn on automatic updates, then there is a slight risk that your site may break and you won’t be online to fix it right away.

Let’s take a look at how to do this.

First you need to install and activate the Easy Updates Manager plugin. Upon activation, you need to visit Dashboard » Update Options page to configure the plugin.

Setting up WordPress automatic updates

Now you need to scroll down to automatic updates section where you can enable automatic updates for core, plugins, themes, and translation files. Once you are done, simply save your settings.


  • Whenever you save a page or post in WordPress it creates a revision.
  • This occurs in both drafts and already published posts that are updated.
  • This can SLOW down your WordPress site.  

Limit/Disable WordPress Revisions
Also recommended is using the WP Disable plugin to deactivate unnecessary settings in WordPress
Whenever you save a page or post in WordPress it creates a revision. This occurs in both drafts and already published posts that are updated.

Revisions can be helpful in case you need to revert back to a previous version of your content. However, they can also hurt the performance of your WordPress site. On large sites this can add up very quickly to thousands of rows in your database which are not necessarily needed.

And the more rows you have the larger your database in size, which takes up storage space. Follow the steps below on how to delete, limit, and disable WordPress revisions for faster performance.

It is not uncommon for older sites to have 100+ revisions on their main pages. This is simply due to years of editing and updating content. Let’s say for example a site has 700 pages or posts with 150 revisions on each, this would be over 100,000 entries in the database. This happens a lot more frequently than you might think.

Thankfully, there are a couple easy optimizations you can make to ensure this doesn’t hurt the performance of your site.

Revision management is one of the perks that WordPress has to offer. The CMS automatically keeps track of the content created on the CMS and makes all of it available for future changes. To the server, this costs unnecessary processing through additional database entries not actually required in the first place. Controlling the number of revisions stored relieves the website core of useless burden.

How to Optimize WordPress Revisions for Faster Performance
  • Delete WordPress Revisions With Plugin
  • Limit Number of WordPress Revisions (Recommended)
  • Disable WordPress Revisions (Optional)
Delete WordPress Revisions
If you are starting a new site, you can skip to the next section as you won’t have existing revisions. If you are on an older site, the first thing you will probably want to do is cleanup and delete the hundreds or thousands of WordPress revisions.

This is where a lot of the magic happens, and you can free up space in your database. If you are trying to do this with a MySQL query, be very careful as there are a lot of bad snippets of code floating around the WordPress repository forums with bad information.

Many suggest queries that sometimes delete a relationship needed to make dashboard links work.
Use the free Optimize Database after Deleting Revisions plugin. It uses the built-in WordPress term functions, which is the correct way to do things.

*Important! Running any type of database plugin could break your site if not done correctly. We always recommend backing up your MySQL database beforehand. If you are not comfortable doing this, please check with a developer first.

How to Delete WordPress Revisions:
Step #1
Download and install the free Optimize Database after Deleting Revisions plugin. You can download it from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins.

Step #2
Click into the plugin settings of “Optimize Database” and input the date of the time for which you want to delete revisions. In our example, we did any revisions that are older than 1 day. Below, select the “check all tables,” which will exclude them from being optimized.

We are not wanting to do anything else in this tutorial other than delete revisions, we will dive into optimization in another tutorial. Scroll down and click on “Go to Optimizer.”

Step #3
  • Then click on “Start Optimization.”
  • You will then see a summary of the space saved and the deleted revisions.
  • We then suggest uninstalling the database optimization plugin and following the next recommendation on limiting post revisions further below.
Limit Number of WordPress Revisions (Recommended)

After you have cleaned up your old revisions, the next step is to limit the number of WordPress revisions that you allow.

This can be a great stop-gap measure to ensure that the revisions don’t pile up again. Perhaps you want to save 3 revisions. WordPress will keep that number and delete any previous ones.

This can be done with the Perfmatters premium plugin otherwise coding is needed. This plugin allowss you to limit the number of stored WordPress revisions or disable them altogether.

Disable WordPress Revisions (Optional)
The last option you have is to simply disable WordPress revisions altogether.

Typically option 2 above is the most commonly used method. However, if you are on a single author site, you might simply want to get rid of them altogether. Remember, it will still save a draft, it just won’t have revision restore points.

Use the free and lightweight WordPress plugin called Disable Post Revision. Simply install it, click into “Writing” in your dashboard, and select the post types for which you want to disable revisions.

  • Hotlinking refers to someone directly linking to one of your images on their own server.
  • What this means is that when someone visits their site it has to load the image from your server, taking up your bandwidth.
Follow these steps to prevent hotlinking for faster performance.

Pingbacks and trackbacks are considered by some as a legacy feature now, and they can cause slowness when it comes to page speed.

  • Login to WordPress Admin Panel
  • Go to Settings -> Discussion
  • Disable Option “Allow link notifications from other blogs (pingbacks & trackbacks)“
  • Save
  • TTFB measures how long a browser has to wait before receiving its first byte of data from the server.
  • Google recommends that your TTFB be under 200ms (milliseconds).

1. Utilize a Fast WordPress Host

The first way to reduce TTFB is to ensure you are using a fast WordPress host. Your TTFB times will decrease simply by using a faster host.

Having a good WordPress host with a carefully thought out architecture is crucial to lowering your TTFB. This also makes a good case for carefully choosing a place physically located in a region where your customers are.

If most of your customers are in the United States, don’t host your server in Europe (although a CDN can help negate some of that).

2. Implement a CDN
Another easy way to decrease TTFB is to utilize a Content Delivery Network (CDN). If you have website that is serving visitors in different parts of the country, or around the globe, this can drastically decrease your TTFB. Location is very important.
Note: If you are utilizing Cloudflare, you might have a slightly higher TTFB. This is most likely due to the additional overhead and complexity of having the fully proxy service running. Remember that Cloudflare has additional firewalls and other features that some CDN providers don’t have. So you would need to make up your own mind which might benefit you more. If your entire site is not properly optimized, taking the hit on the slightly higher TTFB might be worth the trade off.
However, you might also want to check out WP Bullet’s guide on using Cloudflare page caching to lower TTFB. This could require some additional setup and testing. Make sure to run your own tests as each environment is different.
3. WordPress Caching
A third way, and probably one of the easiest ways to decrease your TTFB is to utilize caching on your WordPress site. Many only think that caching can help decrease your load times, but in fact, it also helps decrease TTFB by as much as 90% as it helps reduce the server processing time.
4. Use a Premium DNS Provider
DNS plays a part in TTFB as well. It is hard to exactly calculate how much it is affected, but you can still see overall DNS lookup times and see that there are faster and slower providers out there.
For example DNS lookup times are much faster using Amazon Route 53’s premium DNS. Typically premium DNS providers will have better speeds. Cloudflare is a free one that also has great performance.
5. Load Smaller Files
If your web page is loading very large files, this content can also take a long time for the browser to download and display to users on the site. Whenever possible, serve scaled images (using a plugin like WP Smush or EWWW Image Optimizer Cloud), and minify your CSS and Javascript files (using plugins like Better WordPress Minify or Autoptimize). This will help decrease your TTFB, and allow your page to render faster. You can also defer your site’s Javascript to load lower down on your page, so that it doesn’t prevent the render of the page from happening.
6. Reduce Queries
Often times one of the largest elements affecting your site’s Time to First Byte is the number of queries being run by your site’s themes or plugins to get information from the database. To help identify query bottlenecks, installing a diagnostic plugin like Query Monitor can help you find which plugins, themes, or settings are affecting the site load time.
7. Reduce Autoloaded Data
The wp_options table in your WordPress database stores many important settings for your site. This includes things like defining your site’s URL, theme, and active plugins. There is a column in this table for “Autoload” – when marked “yes,” this indicates WordPress has to load this row on every single page load. If there is data stored in wp_options which does not need to load on all pages by default, you may consider setting these rows to “no” for Autoload instead. To find out what your largest autoloaded rows of data are, you can use the following query under the SQL tab in phpMyAdmin on your wp_INSTALL database:
SELECT LENGTH(option_value),option_name FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 20;

8. Update Plugins and Themes
As simple as it may seem, plugin and theme authors often add optimizations in their updates. This could mean they have optimized the queries that their code runs to the database, or made updates that affect the efficiency of their PHP code. They also often release security updates. It’s important to stay on top of these updates to make sure your site stays secure and fast. Also keep in mind, some premium themes and plugins aren’t listed in the standard WordPress plugin database and may not show updates when they are available.  Be sure to keep your licenses up to date, and periodically check for updates from your premium plugin or theme provider.

9. Limit Other Directives
There may be some PHP directives you want to include in your .htaccess file. However, many of them (like caching directives, gzip directives, and more) are already configured higher up on the server and do not need to be set in this file. Whenever possible, keep your .htaccess file as short and clean as you can.

10. Amount of Traffic
To some extent, the amount of traffic your site receives is also outside your control. However, the scalability of how your server responds to the traffic is something you can control. The higher your site’s cacheability, the more requests your server can serve at once. If your site is receiving a large number of uncached requests however, this can increase the server’s CPU load which will also affect the Time to First Byte. When you’re anticipating a spike in traffic, it’s important to ensure your site is able to scale to the amount of traffic you’re expecting.
High TTFB is primarily caused by:
  • Bad network conditions between client and server
  • A slowly responding server application
  • Domain provider name server is slow
  • Web hosting provider taking time to respond
  • Server is not properly configured
  • MySQL is taking time and running slow on load
  • PHP is rendering slow
  • Amount of traffic
  • Dynamic content creation
  • other...
Here is how it works:
A client visits your website... (
STEP #1: An HTTP request is sent from the client's (browser) to the server. In this step, there are a variety of factors that can introduce delays...
  • slow DNS lookup times could contribute to increased time for the request
  • if the server is located geographically far away, this can introduce latency
  • if you have complex firewall rules this could increase routing time
  • and don’t forget the client’s internet speed
STEP #2: The server now has to process it and generate a response. This could introduce a number of different delays such as...
  • slow database calls
  • too many 3rd party scripts
  • not caching your first response
  • badly optimized code or WordPress theme
  • inefficient server resources such as disk I/O or memory
STEP #3: After the server processes the request, it then has to send it back to the client (or rather send back the first byte). This is heavily affected by...
  • the network speed of the server
  • the network speed of the client
  • If the client has slow internet from a Wi-Fi hotspot, it is going to reflect in the TTFB
Is TTFB important?
It is important to understand that TTFB (time to first byte) is not the same as website speed. This is really a measurement of responsiveness. There are a lot of discussions around the web on whether or not TTFB is important.
Rather than spending time debating the matter, we'd would rather focus on optimizations you can do to improve this metric. Everything you do can contribute to the overall speed of your WordPress site, will affect your TTFB.
Testing your TTFB...
we recommending using to test your TTFB

The Bottom Line:

There are other things you could do to reduce TTFB, such as database caching, Disk IO, Swap usage, RAM, PHP settings, MySQL settings, network settings, TLS overhead, etc. But the ones mentioned above are fairly easy to implement and will give you the fastest performance boost. So the next time someone asks you how to reduce your TTFB, remember that a fast WordPress host, CDN, caching, and DNS all play a huge part. Fixing or improving those bottlenecks will do the trick.

The loading time difference between a Google font and a web safe font is almost a 200ms. Web font optimization is a complex topic...Learn more about web font optimization strategies here:
  • Brotli compression is a new, open-sourced, compression algorithm developed by Google to help further reduce the size of files.
  • Since Brotli is still new, it isn’t yet available on all CDN providers yet. But there are a few such as KeyCDN and CDN77 which now support it.
  • In most cases, your web host must also have Brotli enabled for this to work.
According to Google, image compression should be automated. It's easy to forget to optimize new images and content that doesn't go through compression can easily slip through the cracks.

  • Open your hosting cPanel
  • Click onto your public_html folder
  • Locate the .htaccess file
  • Select ‘Code Edit’
  • Add the following lines of code into your website’s .htaccess file:  
               <ifModule mod_headers.c> Header set Connection keep-alive </ifModule>
  • Save the file and refresh your browser
NOTE: Always perform a full site and MySQL database backup before doing this optimization.

When a user visits your website, your website files will be stored on their computer so that your website loads faster for them the next time they visit there's an expiration date in the file header.

Configure the expires header so that it doesn't impact your server and page load time.



The difference between your website and your competitors is instantaneous page loading speeds done with advanced optimizations.

BEST PRACTICE: Always backup your site before performing advanced optimizations

34. PJAX
  • PJAX is the combination of something called pushState + AJAX
  • PJAX essentially eliminates latency
  • There is a 200-300ms lag time between when a user hovers over a link and when they click the link.
What PJAX does is load a page in the background the moment a user hovers over a link. The effect is the perception of instantaneous page loading.

How to do PJAX:

Use the Turbolinks plugin. Note that you can make a pull request for any debugging issues that you may encounter through the developer's GitHub repository.

If your WordPress installation does not play nicely with PJAX, resource hints can be another great way to boost WordPress speed.

The best code free way to do resource hinting is a plugin called Per page add to head.

By default, cached data will not be stored persistently across page loads unless you install a persistent caching plugin.

Here is a list of persistent caching plugins recommended by
Ajax is a JavaScript based technology that allows a web page to fetch new information and present itself without refreshing the page.
  • The Heartbeat Control plugin helps you to manage the frequency of the WordPress heartbeat API to improve your website performance.
*It is recommended that you disable everywhere except for your post edit pages.

WordPress provides the ability to fetch any kind of post from the database. But inefficient code can slow down this process. For an elegant approach to achieving similar functionality without negatively impacting performance, check out Martin Di Felice's article on post fetching optimization here.

This optimization can be accomplished without any coding. The Plugin Organizer plugin allows you to selectively disable plugins on a post/page. And to setup the order in which the plugins are loaded/initiated. This is ideal for larger sites.
Important! Reordering or disabling plugins can break your site. Backup WordPress before using this plugin!
Uncached pages are murder on performance and user experience. So we're going to keep your server side cache warm at all times so that no visitor ever gets an uncached page. This is relatively easy to setup with the Warm Cache plugin.

Cache Warming Pre-requisites:
Whether you can use HTTP/2 with WordPress actually depends on whether your hosting company offers it. So you'll have to confirm the actual availability of the new protocol with your hosting company.

Your web server can be configured to increase performance. There are a range of techniques including web server caching, enabling gzip compression and setting cache headers that help reduce load per visitor. Do a Google search for your specific web server optimizations (for example, search for "apache optimization" for more info). Consider learning the differences between Apache and Nginx.

43. MySQL
MySQL optimization is a black art in itself. A few simple changes can have a dramatic effect on WordPress performance because WordPress repeats a lot of queries on every request. Do a Google search for "MySQL optimization" for more.

There are various PHP accelerators available which can dramatically improve performance of your PHP files. The following article provides detailed instructions on how to do PHP optimizations in WordPress:
Typically the free DNS provided by domain registrars like GoDaddy and Namecheap is very slow. Google domains is probably one exception to this rule simply because they have such a large infrastructure. Premium DNS providers offer a lot of advantages such as security, DNS failover, and faster performance.

Choosing the right host or plan for your WordPress website is key to web performance optimization. WordPress recommends hosting as the #1 thing that you can do to speed up your website.

Test your site through and check your TTFB (time to first byte). It should ideally be <200ms (milliseconds).

These three terms are types of hosting. Somewhat simplified: they determine how many people use the same server as you.
  • On a shared service, you might get hundreds of people on the same server. This means that a hundred people share the same memory, CPU, and other resources. Resources are not shared evenly. A neighbor's faulty site may use up 80% of a server’s resources, leaving 99 other users with 20% or worse.
  • A VPS (Virtual Private Server) is also shared, but usually between fewer users. Resources are shared evenly. If there are 5 users on a server, they each get 20% of the resources. If a neighbor tries to use more than 20%, their site might fail, but the other sites will be fine.
  • On a dedicated server, you are the sole user of the server and all its resources. This completely negates the “bad neighbor” effect that shared services bring to the table.
The higher the performance of your server (processor speed, CPU...) the faster your website will perform.
Another thing that will make a difference is your server location. Distance tends to affect the speed at which you make requests...
For example, downloading a 100MB file from Australia would take about the same time as it does from New York. However, downloading 100 files which are 1MB in size will take a lot longer if you are further away.
Why do the number of requests matter? We'll talk about this concept more in upcoming lessons...But basically, when a website loads it can make a lot of requests (JavaScript, CSS, images, and others) to the server.

By minimizing the number of requests, we can accelerate loading times.

  • Do not use shared hosting unless you absolutely have to. These cost around $3/month. But you get a slower website due to over crowded servers.
  • Do not get dedicated hosting. If you don’t know what you’re doing you’ll be totally lost. Dedicated hosting requires an expert level knowledge of server technologies.
  • VPS is a great way to go. There are plans around $5/month, but generally the cost is around $25 – $50 a month. And some high-end VPS servers are more capable than low-end dedicated servers, so you could find a pretty good deal.
  • Managed WordPress hosting is built with WordPress in mind. It offers server-level caching and other goodies that will make your WordPress site lightning fast. However, there may be some restrictions such as the host disabling some plugins and themes due to speed or security concerns.
For a new business or those less tech savvy, a managed WordPress host might be a better solution.
Managed hosting handles all the technical aspects of running WordPress. This includes...
  • security
  • speed
  • WordPress updates
  • daily backups
  • website uptime
  • scalability
  • performance optimizations
  • and other features
The benefits of managed WordPress hosting include...
  • server architecture that’s designed specifically for WordPress, which usually means better performance
  • built-in server-level caching, which also means better performance
  • automatic WordPress updates to keep your site secure and functioning
  • automatic backups to ensure your WordPress site’s data is safe
  • all the customer support agents are WordPress experts
  • WordPress-specific security tweaks, like
  • firewalls
  • login hardening
  • and malware scans
How To Easily Speed Optimize Your Managed Hosting
The WordPress Optimization Guide recommends upgrading to hosting plans which offer more SSD (Solid State Drive) server resources.

The amount of server resources you get is the main factor when it comes to hosting and site speed.
Your website will load faster with the higher plans.

Don’t forget to activate Cloudflare (free) in cPanel which makes your site even zippier.

Also in Cloudflare...Turn on aggressive caching, minify code, and Railgun for even quicker load times…
VPS hosting is recommended over managed hosting.


If all this seems overwhelming—take a deep breath. And start with these five optimizations that will give you the most bang for your buck...
  1. Deleting Unneeded Plugins
  2. Caching
  3. Image Optimization
  4. Using a CDN
  5. Upgrading to a faster hosting plan.

👋 Additional New Blogger Resources

These articles will help you avoid the growing pains when it comes to your first blog – enjoy!:

Frequently Asked Questions

How to you prevent image hotlinking in WordPress?

  • First, you’ll need to download a free FTP client such as FileZilla
  • Make sure to back up your website, since you’ll be tweaking one of your WordPress core files.
  • Next, open your .htaccess file by access your website via FTP and then going to your WordPress root folder.
  • Look for a file called public_html, although some hosts default to www or your site’s name.
  • When you’ve found the right folder, look for the file called .htaccess. Right-click on it, and choose the View/Edit option.
  • Add the following code snippet to your file:
/* Prevent image hotlinking in WordPress */ RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC] RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC] RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC] RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC] RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC] RewriteRule \.(jpg|jpeg|png|gif)$ - [F]

What this code does is prevent sites other than yours, Facebook, Twitter, and Google from accessing your images. There is an additional line with an example of another whitelisted site. Go ahead and add other sites (if needed) using the same format as the first two entries.

The last line indicates which file formats you’ll apply the hotlink prevention rule to. You can add or remove options. Just replace the URLs in the example above with your own URL. Remember to save the changes to your file.

And that’s it – you just blocked image hotlinking at a server level!


Popular Posts