Last week, we wrote an article announcing that we have switched our site from WP Super Cache to W3 Total Cache. That article also announced our partnership with MaxCDN. Due to a very high volume of request, we have decided to create a step by step user’s guide to installing and setting up W3 Total Cache for beginners. In this article, we will show you how to install W3 Total Cache Plugin, set it up properly so you can maximize the benefits. We will also show you how to combine W3 Total Cache with CDN services to make your site load even faster.
Before you begin, we want you to download the YSlow Addon for Firefox and run it for your site. Write down the load time of your homepage, and the letter grade YSlow gave your site.
What is W3 Total Cache?
W3 Total Cache is the fastest and most complete WordPress performance optimization plugin. Trusted by many popular sites including: Mashable, Smashing Magazine, WPBeginner, and million others. W3 Total Cache improves the user experience of your site by improving your server performance, caching every aspect of your site, reducing the download times and providing transparent content delivery network (CDN) integration.
1. Installing W3 Total Cache in WordPress
Before you install W3 Total Cache, you need to make sure that you uninstall all other caching plugins (for example WP Super Cache). If you do not do this prior to installing, the plugin will have issues upon activation. We have a very thorough guide explaining how to install a WordPress plugin which you can follow. Or you can follow the brief guide below:
Go to your WordPress admin panel, and click on Plugins » Add New, where you will search the name “W3 Total Cache”. You should see results like the image below:

Install and activate the plugin. If you choose to do this via FTP, first download the plugin and then upload it in to your /wp-content/plugins/ directory. Upon the activation of this plugin, a new menu option will be added in your WordPress admin panel called “Performance”. Click on the tab, and you will enter the configuration area.
2. Settings and Configuration of W3 Total Cache
W3 Total Cache is a very powerful plugin, so it has tons of options. This could be a good thing or a bad thing. For those who know how to use these options, they are a gold mine. For most beginners, they are not a gold mine rather you risk getting your site suspended from your host. We will visit each of these options in detail, so you can make an educated decision. First we need to start with the Default Configuration that would work well on most sites.
General Settings
You can go to the General Settings Page by clicking on the Performance menu button in your WordPress admin panel.

When you first activate the plugin, W3 Total Cache is in the preview mode. You can change settings around and click deploy. When we usually set this up, it is on a new site, so we simply click on the disable button which disables the preview. Now that plugin is actually active, lets take a look at different options that it offers.
What is Page Cache?
The first option that you see is Page Cache. It is responsible for creating static cache pages for each page that is loaded, so it is not being dynamically loaded upon each page load. By having this enabled, you will significantly decrease your load time. Refer to the image below to see how Page cache works:

As you can see normally when a user comes to the site, they see a WordPress page. PHP recognizes the call, goes to the MySQL Database which finds the page your user is looking for, then outputs it. This takes server resources. Having the page caching turned on, allows you to skip all that server load and show a cached copy.
For Shared servers which most beginner users are using, the Disk:Enhanced Method is highly recommended. You should check the Enable Page Cache box, and save all settings.

For most folks, this is all you need to do with page caching. Because this guide is for beginners, we will not show the advanced settings of page caching because the default options are sufficient enough.
We will skip through Minify, Database Cache, and Object Cache. The simple reason is because not all servers provide optimized results with these settings. We will cover this later in the article.
Next option you will see is Browser Cache.
What is Browser Cache?
Every time someone visits a website, your browser downloads all the images, CSS files, JavaScripts etc in a temporary folder to enhance the website experience. So when a user goes to the next page, the site will load much faster because all the static files are in their browser cache. Browser Cache option in W3 Total Cache sets a time limit on the Browser Cache. Considering you don’t change your logo every day, having static files like that cached for 24 hours does not hurt you. Simply check the Enable Browser Cache option and click Save all settings button. Once you have done that, then lets visit the Browser Cache page for more settings.

As you can see in the image above, we pretty much enabled everything except for the 404. When you save the settings, all the settings below on that page will automatically take care of itself.
In our free WordPress setups, this is the default settings that we turn on.
After the Page Cache and Browser Cache, the other option that will work on most servers would be the CDN.
What is a CDN?
It stands for Content Delivery Network which allows you to serve your static content from multiple cloud servers rather than just one hosting server. This allows you to reduce server load and speed up your website. We have created an infographic on What is a CDN and Why you Need a CDN for your WordPress Blog. We highly recommend that you check it out, so you can make an educated decision.
W3 Total Cache supports MaxCDN, NetDNA, Amazon S3, Rackspace Cloud, and Amazon Cloud Front. WPBeginner is using MaxCDN. This section will only apply to sites that are using CDN, or are planning on using CDN. If you think you will be using a CDN, then we recommend MaxCDN (use coupon “wpbeginner” for 25% off). Your screen on the General Settings Page of W3 Total Cache should look like this (Enable it and select the CDN type).

Now that you have enabled, let us show you the setup process. It is a little biased because we are only showing you how to use MaxCDN (because we use them, and they are our good friends/partner).
Setting up MaxCDN with W3 Total Cache for WordPress
You need to have an “Origin Pull” CDN account. Origin-Pull is simple to use and highly transparent. This type is also known as “mirror” CDN.
1. Login to your MaxCDN account (If you don’t have one, then get one).
2. In your MaxCDN dashboard menu, click on “Manage Zones” option. Then click on “Create Pull Zone” button, just like it is shown in the image below:

3. On the next page, you will need to fill out the necessary information to create a Pull Zone:
- Pull Zone Name: This can be anything without spaces, minimum 3 characters long. Think of this as your username.
- Origin Server URL: Enter the URL of your wordpress blog. Must have “http://” and the trailing slash(/).
- Custom CDN Domain: This is Optional, but we recommend it for the sake of branding. Use any subdomain for example: cdn.wpbeginner.com
- Label: This is like a description field. It is optional to add a description.
- Compression: We recommend that you enable this as it will save the usage of bandwidth on your account.
We have filled out the fields for you to see in the image below:

Upon creation, you will see a screen that will give you the URL for your CDN. If you chose the option for Custom CDN Domain, it will ask you to create a CNAME record for that domain. We will show you how to create the CNAME Record with cPanel Webhosting providers such as HostGator, Site5, and Bluehost. You will need to login to your cPanel, then scroll down to the Domains Section and click on Simple DNS Zone Editor.

Then you will fill out the fields to Add an CNAME Record. The two values, you will be required to fill are: Name and CNAME.
- Name: This would be what you put in your MaxCDN Pull Zone as the Custom CDN Domain. In the image above, you see that our custom CDN domain is cdn.wpbeginner.com, so we will put “cdn” in our name field.
- CNAME: This will be URL provided to you by MaxCDN when you create the Pull zone.
We have filled out the fields for you to see in the image below:

Now, you have the CNAME created for your MaxCDN Pull zone. Note: This method will be different if you have a different host. Sometimes, CNAME records are created via Domain Registrar such as Godaddy.
Lets configure our W3 Total Cache Plugin to work with MaxCDN. In the general settings above, you have already enabled Content Delivery Network option and set it to Mirror: NetDNA/MaxCDN. So now when you go to the CDN Settings page, you will see an option for Configuration. W3 Total Cache wants you to enter the API ID, and the API Key. These can be found in your MaxCDN Dashboard if you go to Manage Account » API. Copy those and paste it here. Next complete the field that asks you to “Replace site’s hostname with:”. You will add your custom CNAME here. You can see in our example below, we have added cdn.wpbeginner.com.

After setting this up, your MaxCDN should be setup and ready to go. Now if you load your site, the image URLs should be served from the CDN subdomain rather than your site’s actual domain. For example:
http://www.wpbeginner.com/wp-content/uploads/2010/08/w3totalcachecdnconfig.gif
would be replaced with:
http://cdn.wpbeginner.com/wp-content/uploads/2010/08/w3totalcachecdnconfig.gif
Now if any of your static files are not loading with the CDN, then it probably means you will need to specify it in the custom files list setting in W3 Total Cache. We had to do it for OIO Publisher plugin that we use for serving ads. If you go to the CDN settings page, you will see the Advanced option:

Simply add all the files/folders that you want to include for CDN. Also if you notice, there is a rejected file list. When you make a small design update, your style.css will not update right away. So you can put that in a rejected file list for the time that you are making changes. If you just want a one-time purge, you can do that over in MaxCDN settings.
Everything that we have covered up till now, will work great on most web hosting accounts. Because W3 Total Cache comes with other options, we will do our best to explain what they are, why we do not enable them on all sites.
Minify
Minify simply reduce the size of your static files to save you every single kilobyte that you can. However, sometimes generating that minified file sometimes can crash your site. We are not saying that it is a horrible function. We are simply saying that it does not work with all sort of server settings. We have heard numerous users complaining about it, and our host (HostGator) recommended us to leave this off. If you are like us (NOT SAVVY with server lingo), then listen to your web hosting provider.
Database Caching
Database caching reduces the server load by caching SQL queries. This eliminates the processing time of querying the database (which may not be a lot for smaller sites). When we started using this, it seemed to put a lot of load on our server. Our host recommended us to turn it off. Instead, they ended up turning on the built-in SQL caching for us. Again, use this option at your own risk. You can try it out and see how it impacts your site load time. Then simply turn it off, if the impact is not significant enough. Most hosts do not recommend this for shared hosting accounts.
Object Caching
If you have a highly dynamic site, then using the Object Caching will help. This is mainly used if you have complex database queries that are expensive to regenerate. For most beginners, this will not help.
Now that you have everything setup, it is best to create a backup for your W3 Total Cache Configuration. After all, we went through a lot in this article. You will need to come back to your W3 Total Cache’s General Settings Page. There is a section for Import / Export Settings. Click to Download the settings file from your server.

This is good to do because if your site crashes, or you accidentally reset the settings, you will have a file to backup.
We hope that you found this article useful. For those users who are still not sold on the concept of CDN, we highly recommend you give it a shot. CDN work with your web host to decrease server load and increase site performance. We are using MaxCDN and we recommend you to do the same. (Try them for just a month, and you will see why we recommend them). Use the coupon “wpbeginner” for 25% off.
If you have any questions, then please feel free to ask in the comments below. Also don’t forget to share this article on Twitter, Digg, Facebook using the buttons to your left. We truly appreciate your support.







Hello,
This is a great guide… think maxcdn soon!
1 – What about maxcdn and wp multisite … need 1 or more extra zone?
2 – What about js, css, images…. Is it combined (compressed) in maxcdn OR need minify… in w3tc?
Sorry for my bad english.
MaxCDN pull zone mirrors whatever is in your site, so you would have to compress/minify on your end. You can use the same zone on multiple sites as long as the origin URL is the same.
Hi,
I downloaded the W3 Cache plug-in and set up the Max CDN account. As far as I can tell, I followed the directions exactly but when I test MaxCDN I get — Error: No zones match site: http://danaburk.com.
Let me backtrack and say this; when I went to the CDN section, you showed you had selected NetDNA/MaxCDN–mine allowed one or the other, I chose MaxCNA since that is the account I set up.
The only other thing, is I did not opt to do a custom CDN DOMAIN so therefore did not go in and change anything at my host site.
Any ideas?
Thanks, Dana
You have to be a MaxCDN customer and create your zone with the origin URL being the same as your WordPress site url.
Well written…just increased my client’s site from 76 to 88 PageSpeed score. Stoked!
A true helpful blog for new bloggers
Thanks to you
Thanks for the clear directions! Google Speed checker said my website went from a 43 to an 81 out of 100. I know I have some work to do but this was a huge step forward.
hello,
thank for the great tutorial, i finally started using MaxCDN it works great. But i am having some issues excluding some directories from the cdn using w3 total cache. Any ideas how it’s done?
Thank you
In the CDN settings, you just have to add to the exclusion list.
In Browser Cache setting, Set W3 Total Cache header keeps unchecking after I save. Can anyone provide a solution? Thanks!
Thanks for this great post guys.
Keep up the good work.
CheerS.
Hello, does this work well with WPMU?
Yes it does.
Thanks for these clear instructions! One question though – If I followed all these instructions while setting up this plugin and I don’t configure the CDN part, will all the other settings work to help performance on my site?
Yes it will.
Would be nice if you can update this page for the latest versions of W3 Total Cache and MaxCDN
In the works.
Hi,
Very helpful article, thanks! MaxCDN changed the way you get an API ID and an API key, you have to create an application first. It would be great if you explain those steps as well. MaxCDN uses other names than ‘API ID’ and ‘API key’, some explanation about which fields you should copy-paste would be helpful.
Thanks!
Taco
We are waiting on W3 Total Cache to release an updated version of the plugin to rewrite this article. It is in the works. From what we were told is that you apparently don’t need the API key to make MaxCDN work on your site. You only need it if you want to purge cache using your site.
I started using MaxCDN yesterday, and I dd it without the use of the API, as directed by MaxCDN’s customer support. All I did was enable Max CDN in W3 Total cache and then enter the CDN URL as supplied by Max CDN. All working well for me so far
Almost one year I didn’t setup well the plugin after I installed, now I only realize the power of W3 Total Cache, thanks for your post, it’s really helpful!
After following your steps, whenever i load my page, only the mobile version appears on pc
What are you using for making the mobile version of your site?
i am using mobilepress for my mobile version
Hi, I followed your guidelines, I opened account with MaxCDN and I did everything step by step on site5 hosting, I did a text for the CDN and it works but my site does not load any image / CSS – it totally brakes
Any idea what I should do?
No idea why it would do that. Have you tried contacted MaxCDN support?
thanks for your simple way in explain the steps and i have a question what is the approximate percentage for speed up using w3 just and for using w3 with CDN
The speed will vary based on the type of configuration you do and the type of server you have. Rest assured, it is significant
Hi ,
Great tutorial but I am facing one problem. I have followed all the steps and configured maxcdn and edited the DNS zone & then copied the settings to w3 total cache but when I test the NetDNA it shows “Error: Unable to purge (Your IP Address is not whitelisted).” How can I remove these error? Please help.
I may look a little silly but have to ask: when I add the Pull Zone Name does this have to be the URL of my website or can I make that anything? The reason I am asking is that I believe I can add multiple domains and I have one for web development and another for events with different domain names
You can create a custom cname record like this article shows.
Hi, when i do your settings it shows this message on top:
It appears Page Cache URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in the configuration.
What do i need? Thanks.
You have to go to the W3 Total Cache plugin page. It has .htaccess rules that you may need to add.
On the Internet are there many tutorials about using w3tc. I followed all of them, but nothing helps. All these tutorials lead to a slower website. The load speed of my site without w3tc is 0.6 seconds. With your manual and w3tc is the load speed of my site 3.5 seconds.
Would be interested in seeing your website that loads within 0.6 seconds without any sort of caching. Which tool are you using to check? Where are you hosted?
I use this code:
queries. seconds.
The load time of my website in now 13 seconds with w3tc en CloudFlare!!!!
Hey there -
Thank you for this tutorial. You guys made it so that I went with MaxCDN.
I use WordPress (of course), and W3 Total Cache, MaxCDN, AND I am hosted by Hostgator, just like you guys.
But, I have an issue with my site through WebSense…
I followed your tutorial all the way, but for some reason my CSS files, as well as my favicon file receive a blockpage link in WebSense (which I call WebNonsense).
I can access http://mydomain.com/wp-content/uploads/2012/08/favicon.png
I can also access http:///wp-content/uploads/2012/08/favicon.png
But, I can NOT access http://cdn.mydomain.com/wp-content/uploads/2012/08/favicon.png
Have you guys, or someone else, experienced anything similar?
wpbeginner.com works perfect through WebSense….
I am a bit clueless.
Suggestions anyone?
Thank you for an awesome site!
~ TJ
My second link should have shown: http://the.maxcdn.cname.url/wp-content/uploads/2012/08/favicon.png
~ TJ
Never experienced something like this before.
Couldn’t you just upload your config file and put a link on the page for quick and easy configuration?
Configurations vary from server to server. For example, we are using Memcache on our site and most servers don’t have that enabled. Our goal here is to show people how to do things, so they can do it themselves. By simply giving a configuration file backup, no one really learns anything.
I have disabled Minify and set page Cache to Disk Enhanced. But when I go to Page Cache tab then I see this –
It appears Page Cache URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in the configuration.
Any fix?
You have to update the .htaccess rules in your .htaccess file.
Thanks for this. It was very helpful. So many options. Although I did wind up turning off minify because it killed my css. Glad it was simpler than it looks on the surface.
thats great post