Guides

Unknown Ways To Speed Up WordPress

By November 20, 2018 No Comments

WordPress is probably the most widely used CMS available on the internet with about 75 million websites using WordPress to run their sites. With a massive community of enthusiasts and an overwhelming about on plugins that allow you to customize your site with easy and without coding knowledge you can see why it has one of the larges user bases for CMS management.

While guides on “how to speed up WordPress” are in abundance, this post will do things a little different.

Most guides will have you install multiple plugins that deal with each speed issue when in fact these issues will provide a negligible speed improvement or may even make things worse. You see adding multiple plugins relies on that fact they are compatible. While one plugin may improve a certain speed factor, installing another one for tackle another may adversely effect the first plugins ability to do its job.

Anytime you install a plugin you add tables to the MYSQL database and you also add additional requests to the page. Even if you delete the plugin the requests will be removed but the tables will remain, slowing down the time it takes for the WordPress PHP to find the information it needs within the database.

WordPress speed issues can be solved by being smart about what it is your trying to achieve.

If your reading this i have no doubt you have scanned your site on gtmetrix, pingdom or Google site speed, site speed checkers and you have a less than desirable speed score. Many people at this point will become obsessed with getting a A+ rating and a site that loads under 1 second. Granted a fast website is something every webmaster to strive for but you may be setting your self up to fail by using WordPress in the first place.

The Truth about Speed Checkers

While every one goes on about checking your site speed there are certain things you need to know.

Speed checkers check a site speed from servers they have access too. Usually their a very small pool of servers on which to test your site. Additionally your own server that host your site will usually be located in a different country to that of the speed test servers. For example lets say the speed check site is in the US and your server is located in France. Instantly there will be a delay and a cap on how fast you can make your site based on this test alone due to the time it takes for data to be sent between these 2 points.

This is why your site speed results can change if you where to run the same test consecutively 3-5 times in a row.

If you want to use a site speed checker i would highly recommend gtmetrix. This tool allows you to see the load time of individual requests on your page (waterfall). With this data you can see potential bottle neck requests that are massively slowing down your site.

I dont need to repeat basic speed tips that is already found in so many articles online like”reduce image sizes” “use a cache plugin” “minify CSS and JS”. This post is about making easy actionable changes with as little load to the site as possible.

So without further ado lets get into it.

1. Upgrade your website hosting

OK, you probably know this already but upgrading the server your site runs on will be one of the biggest impacts to the speed of your site. If you run on shared hosting then you are at a massive disadvantage due to the limited resources available to your site.

With a VPS or even better a dedicated server you site can perform the request and load files much faster than it can on shared hosting. If you are serious about site speed, ditch the shared hosting and upgrade.

2. Ditch the cache plugins and use CloudFlare instead

How many times have you been told to install a cache plugin? While they work well they often break the functionality of most sites that use complex themes or plugins. So while these offer a ton of customizable options, rarely can you utilize all the plugin has to offer.

CloudFlare is a much easier and safer option for your site while adding a pretty decent firewall to your site and ability to block common bot and malicious traffic for FREE.

While adding CloudFlare is nothing new, 99% of guides wont give you the information needed to optimize this setup. Just using CloudFlare alone is not enough and there are some hidden settings you can use to vastly improve the speed of your site.

Cloudflare acts like a middle man to filter your traffic by taking over the domain DNS. In essence the traffic is routed through CloudFlare and sent to your website after going through filters that look for patterns of bot and malicious traffic. The servers for CloudFlare are spread all over the world and they have the ability to store commonly used files on your site in their own cache. This means if CloudFlare have a copy of an image in their cache, the CloudFlare server will serve the image, not your server. As the server is located closer to the visitor loading the image, the image loads much faster.

CloudFlare can go further than just caching images, CSS and JS. You can actually tell it to cache everything meaning 95% of your page resources will load from the CloudFlare servers not your own.

To setup this feature follow the steps below:

Visit Cloudflare and sign up for an account. During this process Cloudflare will scan your sites DNS records and allow you to make changes. Once done you can then go into your domain registrar and replace your current DNS records with the ones CloudFlare gives you. (if your unsure on this step Google is your friend, i may make a guide on this in a future post)

Once your DNS records have updated which you can check here, log back into CloudFlare then click the “Page Rules” tab at the top and then “Create Page Rule”

A new window will popup. Copy the setting i have below replacing your domain with my example.

 

Make sure you add the /* at the end the domain. This acts as a wildcard parameter and tells CloudFlare to cache every resource and page regardless of the sites folder structure.

For example:

Without /*

example.com - Cached
example.com/this-is-a-page.html - Not Cached
example.com/style.css - Not Cached
example./category/some-page.html - Not Cached

With /*

example.com - Cached
example.com/this-is-a-page.html - Cached
example.com/style.css - Cached
example./category/some-page.html - Cached

With the cache level set to “Cache Everything” every file and resource CloudFlare can Cache, it will.

Edge Cache TTL is a specific setting used when “Cache Everything” is selected. It tells CloudFlare how long it will keep a resource before refreshing it. This setting will depend on how often your site updates and how long resources change. If you have a static site that doesn’t change often you can set this to a higher limit, if your site changes daily or hourly then set this lower.

I suppose you want to see some results on what this technique can do right?

Before – Dedicated Server, No CloudFlare Cache

After – Dedicated Server, CloudFlare Cache, With Edge TTL

This one method alone managed to speed up my site by 2.2 seconds. That’s a 60% reduction in page load time. More importantly this is without adding any extra plugins or requests to the site.

While your in CloudFlare you might as well decrease your page speed some more by letting CloudFlare Minify your CSS, HTML and JS. Pretty nifty eh!

  • Click the “Speed” Tab
  • Under Auto Minify, tick the 3 check boxes for Javascript, HTML and CSS

Results After Minify

3. Remove Unused Resources and Bloating

Having a great looking site requires the use of a premium WordPress theme. Unfortunately these are often code heavy due to requiring all the necessary CSS and JS files that give these themes there premium features.

The problem here is that even if you dont have some features enabled the files are still loaded when the page is loaded. This is made even worse when you have plugins and features on certain pages but not through the site. The resources are still loaded even tho they are not actually being used on the page.

To combat this the guys over at woorkup created a great plugin that allows you to turn off the loading of specific resources on specific pages

The tool is called perfmatters.

This is a paid plugin that will cost you $19.99 for 1 site, $49.99 for 3 sites or $99 for unlimited sites per year.

The plugin will allow you to remove most of the common bloat issues that WordPress presents and resources that your themes and plugins load but are not necessarily needed.

Here is an example of the GUI that lets you decide what JS files are loaded

I highly suggest you grab this plugin if you want to further reduce your load times.

perfmatters currently have a 10% off code : PERFMATTERS

Hopefully you enjoyed this post and your on your way to speedier WordPress website. If you have any other tips that not many people know let us know in the comments below.