Speed up WordPress by installing and configuring W3 Total Cache and CloudFlare with this helpful guide. Download and import my settings file to help you get up and running quickly.
Make WordPress Faster with W3 Total Cache & Cloudflare
1. Improve WordPress Site Speed with W3 Total Cache +
Cloudflare
mprstudio.com/speed-up-wordpress-w3-total-cache-cloudflare/
Is your website painfully slow? Does it take forever to load? If you answered yes to those questions, you have
a problem on your hands.
It’s important to mention that there are a number of things that can greatly affect your website speed, including the
following:
Your hosting – some hosting providers are terrible (GoDaddy comes to mind), and should be avoided at all
costs. If you have a crappy hosting plan, your site will be slow, period. If you see “reduce server response
time” in your Google Page Speed Insights, then your hosting is slow and you should find a better web host.
The quality of coding in your theme – multi-purpose themes are super bloated and full of features that most
people never even use. Instead of choosing a multi-purpose theme, try to select one that will fit your site’s
needs, but is not overkill.
The amount of WordPress plugins you use on your site. As a general rule, you want to keep the amount of
plugins you use to a minimum.
The speed at which your website loads is extremely important, and cannot be overlooked. Honestly, it makes a
terrible first impression on those unfortunate people who happen to stumble onto your site. The bottom line is that
visitors simply will not wait for your site to load. Instead, they will look for what they need somewhere else, praying
that the next site loads faster than yours.
There are a couple things you can do to speed up your WordPress website, and they won’t cost you a dime. In this
post, you will learn how to configure the W3 Total Cache plugin to use it in conjunction with the free version of
Cloudflare CDN (Content Delivery Network). In addition to speeding up your website, it will make it more secure as
well.
1/25
2. Table of Contents
Configuring W3 Total Cache
1. General Settings
2. Page Cache
3. Minify
4. Database Cache
5. Object Cache
6. Browser Cache
7. Extensions
8. Cloudflare
Configuring Cloudflare
Changing DNS records
Speed settings
Adding page rules
Purge all caches
Common Problems
What is W3 Total Cache?
A caching plugin is a must-have for your WordPress website, and should be one of the first plugins you install.
WordPress is a database-driven content management system (CMS) which relies on queries to and from a MySQL
database to fetch and render both pages and posts. W3 Total Cache is a plugin that improves the user experience of
your site by caching every aspect of your website, resulting in improved user experience and enhanced server
performance. W3 Total Cache reduces website download times by creating static copies of your pages and posts,
which makes them load more quickly.
Take the performance of your site even further by using W3 Total Cache in conjunction with the free version of
Cloudflare CDN. See all free and paid Cloudflare plans to make sure the free version will work with your site.
Save yourself some time and download my recommended W3 Total Cache settings instead of going through the
guide below.
To upload them, go to Performance > General Settings, then click on the Import/Export Settings button.
You will have to adjust a couple things to reflect your site, but it will still save you a good amount of time. Make sure
you enter your URL in the settings under Performance > Extensions > Cloudflare. You do not need a DropBox
account to download the file, just click on the link and the download will start.
Configuring W3 Total Cache
2/25
3. The W3 Total Cache settings are quite extensive, and it is difficult to know which settings are best for optimal
performance. I will walk you through all the different settings with the help of images.
1. General Settings
3/25
12. 3. Minify
If you’re going to use Cloudflare, Minify should be disabled in General Settings – it will be handled by Cloudflare
instead. If you’re NOT going to use Cloudflare, then the default settings are recommended.
4. Database Cache
It is recommended that you use the default settings.
5. Object Cache
The default settings should be used here as well.
6. Browser Cache
7. Extensions
12/25
13. In the Extensions tab, activate Cloudflare, as well as any other extensions you are using. I currently have both
Cloudflare and Yoast SEO activated, but everything else is turned off. Your situation may be different, and you may
have more extensions enabled.
After you activate Cloudflare, click on Settings and configure the extension as seen below.
8. Cloudflare
13/25
17. Enable hotlink protection to prevent crappy websites from using your images on their site, while you’re still hosting
them. They do this by posting an image link on their site which refers to the image hosted on your website. It eats up
your hosting bandwidth, and can put a huge strain on your hosting server. It’s a good idea to regularly monitor the
links to your site using Google Search Console.
After you have configured the Cloudflare extension settings in W3 Total Cache, you will need to create a Cloudflare
account.
What is Cloudflare?
Cloudflare is a company that provides a variety of helpful features, including a Content Delivery Network,
performance and security optimization, as well as website analytics. By using it in conjunction with W3 Total Cache,
you can drastically improve both the speed and security of your WordPress website.
You can get started with the free version Cloudflare in just a few minutes. Simply follow this step-by-step guide and
you’ll have it up and running in no time.
Configuring Cloudflare
To register, simply enter your email address and desired password, then click Sign Up. You will then need to check
your email to confirm your account. After you let them know that you’re not a robot, you can proceed with the setup.
After you login to your account, click the + Add Site link in the upper right hand corner.
Enter your website url in the box, then click the Begin Scan button.
17/25
18. Next, you will click Continue Setup.
Then, scroll all the way down and click on Continue.
Select ‘Free Website’, then continue.
18/25
19. Changing DNS records
At this point, Cloudflare will provide you with two nameservers to use. You will have to change the DNS records at
your registrar. In most cases your registrar will be the same as your hosting provider, but not always (e.g. I
purchased my domain name for http://reyherphoto through GoDaddy, but host the site on InMotion Hosting).
In order to change your nameservers, do a search on Google for “change DNS + name of your registrar.” You will
simply replace the old nameservers with the new Cloudflare ones using the custom nameservers option. Now, you
can head back over to Cloudflare and click on I’ve added all missing records, continue.
Speed settings
19/25
20. At this point, you will configure Cloudflare for optimal performance.
20/25
21. Adding page rules
After optimizing the speed section of Cloudflare, you will want to create a few page rules. You are allowed to use 3 of
them with a free account, and can purchase extra ones if you need them. I think you’ll be set if you just use the 3
below.
Create a page rule for your login page. In most cases, your admin URL will look like this: yourdomain.com/wp-
admin*.
If you have changed the login page (highly recommended for security reasons), then enter the new URL followed by
an asterisk and no trailing slash.
Then, add the following conditions by choosing the proper dropdowns on the left, and setting the options on the right
as seen below. Once you’re finished, click the Save and Deploy button.
21/25
22. Now, create another page rule using your homepage URL (with a trailing slash) followed by *preview=true*. Again,
choose the proper dropdowns on the left, and set the correct options on the right. Then click Save and Deploy.
22/25
23. Create one more page rule for your homepage url followed by a trailing slash and asterisk. Once again, select the
proper dropdowns (only two this time), and set the correct settings on the right. Once you click the Save and
Deploy button, you’re finished setting up Cloudflare’s page rules.
23/25
24. Purge all caches
Once you’ve completed the setup in Cloudflare, you should purge all caches in W3 Total Cache (see screenshot
below). Just hover over Performance at the top of your dashboard, and click Purge All Caches.
Common Problems
Messed-up site appearance – In some cases, using minify will mess up the formatting of your website. If
something goes awry with the look of your site, simply turn off minify in the general settings tab of W3 Total Cache. If
you followed this guide, you won’t have this problem because we took care of minify in Cloudflare, and kept
it disabled in W3 Total Cache settings.
Dashboard is super slow – Make sure that Object Cache is disabled in the General Settings tab of W3 Total
Cache.
Any time your site is acting up, it’s a good idea to disable all plugins, then reactivate them one-by-one to see which
24/25
25. one is problematic. Certain plugins conflict with one another, and some plugins do not work well with certain themes.
If you’ve checked all the plugins and they are not causing any problems, it is likely a conflict with your theme. To be
sure of this, you can switch to a default WordPress theme (try Twenty Sixteen) to see if the problem persists. If
everything works fine when you switch to a default theme, then you know that your theme is the problem. At this
point, you can try to get help from the theme developer. He/she may just tell you to use an alternate plugin which is
compatible.
Slower website load times – You may have to wait up to 72 hours for propagation. When I changed my
nameservers to Cloudflare, the propagation was pretty quick, but it can take a while so be patient.
Your Website Crashes – If for some reason your website crashes, you may need to edit your wp-config.php file.
Open it up and delete the following lines:
/** Enable W3 Total Cache */
define(‘WP_CACHE’, true); // Added by W3 Total Cache
Then, you’ll want to open up your .htaccess file and delete all the lines between and including the following:
# BEGIN W3TC
# END W3TC
Next, you’ll need to delete the following files from your wp-content folder:
advanced-cache.php
objectcache.php
db.php
Finally, you should delete the W3-total-cache folder located in wp-content/plugins.
Conclusion
Website speed is critical, and cannot be overlooked. I don’t know about you, but I have zero patience for slow-
loading sites, and find myself leaving them right away… never to return again. Don’t piss off your visitors, and make
sure your website loads quickly.
Follow and implement the tactics in this guide to boost your WordPress website speed. This post is modeled after
one written by Tom Dupuis of Online Media Masters, who creates a variety of super helpful WordPress guides.
Can you think of any more helpful speed optimizations that I may have missed? Leave a comment and let me know.
Do you need help creating a WordPress website? Sign up for your FREE WordPress Setup today.
If you found this post helpful, please share it and spread the word!
Want more like this? Sign up for my newsletter to receive helpful WordPress Tutorials, Tips and Tricks.
25/25