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.








Thanks, I worked for me!
Hello, Thanks for this tut, I just tried to do this, I got everything right but my site doesn’t load correctly. Most of the images doesn’t load and most of the images neither, soes someone know whats the issue?
Thank you guys, just finish setup my blog using above setting. Just disabled cloudflare and looking to speed up my blog using this one.
Have just downloaded and installed this plugin. One of the best plugins I have seen!
Thanks alot, i’m just registered at MaxCDN and this post really help me setup successfully
Even though you added “/random-posts-from-wpbeginner/” in the “Never cache the following pages:” setting for W3, it appears the page is (1).broken and (2). still connected to your cdn. So, why isn’t the page never cached like you told W3 you wanted? I ask because the exact same thing is happening to me with this feature
The page is now broken because we switched themes and didn’t need that page anymore. So no page template. Page Caching and CDN are not related. It will still get info from CDN, unless I exclude it.
Heh, This just helped me out heaps, thanks
Nice tutorial, however, is there any solution to flush my cache every 12-24 hours. On one of my sites there is an “offer” that changes every day and since the pages are cached on different days, they show totally different offers – ones that are cached previously.
Does anybody know how could I do this? Is there any settings I haven’t noticed? Or is there any plugin for that? Thanks
Very easy to follow tutorial. Just registered with MaxCDN and applied to my site with w3tc plugins. Used your coupon also. Thanks a lot!
wow I wanna use CDN too but still not enough traffic on my site
@dailyblogtools 100% just don’t touch CDN section. Most of the users don’t have CDN. You only need it if you have some good traffic numbers.
Awesome dude…best tutorial ever!!!
dailyblogtools: yes. WP Total Cache provides CDN configuration as an option and not a requirement.
Does “Minify” feature change my actual theme files? Would I have to backup my site before using “Minify” feature?
No, it won’t change your files. It is a good idea to back them up regularly if you can.
I think this tutorial needs an update, there are some new features of W3 Total Cache uncovered here.
@Jakob T Consider watching our tutorial in the Beginner’s Guide category on how to use FTP. That will show you how to change the CHMOD permission.
I get this popup message on W3 Total Cache plugin page:
/home … /wp-content is write-able. When finished installing the plugin, change the permissions back to the default: chmod …. /wp-content.
And on the installation page within the plugin, it says:
“1. Set the permissions of wp-content/ back to 755, e.g.:”
What does this mean?
@mrintech What is being mentioned in the freshbooks article is the famous www / non-www issue which splits pagerank… The reason why your pagerank gets split is when people link to a site, they sometimes write www and sometimes they just don’t write http://www…. now if your site doesn’t have proper 301 redirect setup for one or the other, then google believes that it is two separate pages. This causes them to assign separate pagerank which dilutes your page strength thus giving you a lower pagerank on both names rather than one high pagerank.However, in this situation no other site will be linking to your files.yourdomain.com link…. This subdomain is for internal use ONLY… So you would not have that issue.Hope this clarification helps.
Hi
Thanks for reply
What you are saying is absolutely correct. But will this create Page Rank Splitting Problem? as defined in this article: http://www.freshbooks.com/blog/2006/08/16/dont-split-your-pagerank/ – As both MAIN Domain and Newly created Sub-Domain are showing the same Homepage content
Anyways, just wanted to know: When we create a Sub-Domain like thing using CNAME, is it possible to redirect it to Main Domain/Any other sub-directory using .htacess, PHP etc.?
Help appreciated from masters here
Thanks a lot and regards
@mrintech The subdomain is for internal use only… so the page it opens should not matter because nobody should be accessing that name anyways…
I just setup “files.mrintech.com” Custom Sub-Domain in MAXCDN >> Created a CNAME record in cPanel >> Entered “files.mrintech.com” in W3 Total Cache
Everything is working fine, but when I enter http://files.mrintech.com/ – It opens Homepage content i.e. mrintech.com
I don’t want this. Any solution? like redirection etc.
@wpbeginner
If you’re using Gravity forms with the really simple captcha plugin instead of recaptcha, add this line to the excludes :
wp-content/uploads/gravity_forms/captcha/*
I followed this guide and it works great thank you!
I also wanted to change: “Minify Cache Method” to eAccelerator as i’m running on my own server i know that eAccelerator is installed but all these are disabled and the only think i can choose is “Disk” ?
Any idea how to enable it and if it will give me any more improvements?
Hi I followed the instructions carefully everything is working fine. However, I’m unable to log out of wordpress properly. For example, when I click log out I’m taken to the logged out page and it says I’m logged out, then, I click return to site and I’m still shown as being logged in the wp-admin bar. Help please!!
Unabel to get cdn working
Nightmare unable to get cdn working with total cache. SQL errors every time I press the test DNA option. I’ve been using my cdn for years without issue before
I think i’m gonna go back and test Total Cache today and see how it compares to Super Cache –… lets see how this goes
Very good article. I have tried it today and works great. I noticed that you are NOT using database caching and also not css minification.
I also add problems with Total Cache when I tried it a few months ago so went back to Super Cache.
For those already on Super Cache and wish to switch please follow the instructions clearly on de-activating super cache its not always as simple as deleting the plugin … there are other files (htaccess) which may need editing…
r_kib kire ki koros?
Wonderful tutorial, i just set up an account with maxcdn and emplemented it following your tutorial!
thank you
I would like to warn everybody.
I am not saying that you will have those kind of problems but check it.
I installed 22 april W3TotalCache with CDN support.
Till then i have huge performace problems on my VPS server.
Today, almost 1 month later i solve them.
The reason for my problems was W3TotalCache, plugin produce high CPU and memory usage…
I replace that plugin with WPSuperCache with CDN support and finally everything is ok.
Tnx
Well what were your settings? It’s completely possible to select incorrect settings and have poor performance because W3TC allows for so many possible configurations.
This is a great post.
Just one question though, if anyone knows: I’m using the Total Cache plugin with Cloudfront as the CDN.
So, when I’m minifying the javascript–should I list the original strings, like this:
http://www.fakepage.com/fake.js
Or should I minify the CDN version of that string:
http://www.cdn.fakepage.com/fake.js
If anyone knows, I’d be curious.
The first method. Because W3 Total Cache minifies your file, then it too is served via CDN.
Hi! I followed your tutorial step by step, but it keeps giving me this message : “Fancy permalinks are disabled. Please enable it first, then re-attempt to enabling the enhanced disk mode”.
Can you please help me?
Yes, please change the permalink: http://www.wpbeginner.com/wp-tutorials/seo-friendly-url-structure-for-wordpress/
Hi guys
Ive had this plug in for quite a while now, but its just started causing my site to load REALLY SLOWLY so ive had to deactivate it for now which is a shame as i need to increase the speed of my site somewhat.I have only updated other plugins lately so i dont know why??
Do you have any idea what i can do to rectify this please?
thanks
Wonderful tutorial, I implemented this on my site without the CDN and I can say wow much better, thanks. I’d like to have permission to repost this on my WordPress tweaks site located at tech2geek.com.
Hey Troy,
We don’t allow direct replica of our tutorials. If you want, you can write an excerpt, and then link to the full article.
I’ve set up an account with MaxCDN and configured W3 Total Cache just like it said in the tutorial.
Now when I go to my site it appears as if none of the stylesheets are used. All of the markup seems to be gone.
Any thoughts on how to fix this would be greatly appreciated!
None of the images are displayed as well. Everything that is supposed to be loaded from MaxCDN isn’t displayed.
Yes, that means that your simple zone editor DNS is not propagated. You might want to use the link they gave you for the time being.
Which link do you mean exactly? The example.example.netdna-cdn.com instead of using cdn.example.com?
I’m sorry, I’m just a total noob at this.
Everyone at the MaxCDN team would like to thank the team at wpbeginner for such a great article. We would also add our wiki link for some of the newer advanced features that have been added to the W3 Total Cache plugin at http://wiki.netdna.com/Implementation/Wordpress
Thank you very much for this tutorial! Just set mine up. I forgot all about the Simple DNS Zone Editor!
I’m using Total Cache, and TDO Mini Forms. I’m trying to exclude all forms from caching, but not having any luck. I used the exclude the following pages area, and tried entering the full url, as well as just /find-it (the name of the page the form is on) without any luck. I have it set up so that only registered users can access the form, but the problem is that if someone goes to access the form first, they’re told to log in. Then when they log in, they’re shown a cached version of the form, which of course tells them to log in again. Any help solving this would be greatly appreciated. Thanks!
Exclude the specific page that the form is on from being cached.
Useful article for every WordPress User, thank you very much
Hello, Great post. I followed the instructions but am unable to see my images. What am I doing wrong? Thanks for assistance.
Are you using MaxCDN? why can’t you see your images?
Nice post, its realy a great plugin as helps keep the website fast. I use this plugin for all my wordpress sites.
Help! I was following these instructions, and when I turned on database caching and object caching, all the comments on my blog disappeared! (I also turned on “set expires header” for everything except HTML).
I’ve turned off these settings now, but the comments are still gone. Is there any way to fix this without restoring a database backup?
Thanks so much.
Following up on this, I checked phpMyAdmin and saw that the wp_comments table is listed as “in use” with no entries for “records”, “type”, “collation”, etc.
I’m not sure what this means–thanks again for your help.
A further update: I tried running the table repair tool in phpMyAdmin, and this fixed the problem (it gave a message that said something like “number of lines changed from 9049 to 9048″). Now the entry for wp_comments in the database list is normal, and the comments are back on the blog.
I would still love to hear thoughts on why W3 Total Cache caused this to happen. I want to continue trying to optimize my site, but I’m a bit scared to make further changes to the plugin settings now.
Don’t know why that happened… Are you on a shared host?
W3TC does not modify your database, it only reads it. The caching exposed database corruption as W3TC is watching every database interaction to look for things it can cache. It’s important to run repair tool often, simply put: caching can’t fix broken things.
Hi Frederick,
Thanks for the response. When I have some time to monitor the site, I’m going to try turning on database caching again and see if it goes smoothly now that the repair tool has been run on all of the database tables.
Vernon
hi! thanks so much for the help. I was desperate.
Hi there! I’m using W3 Cache in WordPress.
Everything is working fine, but in Safari (MacOS 10.6.6, Safari 5.0.3) the caching is during days and days (showing content very old).
I’ve tried disable (as now) browser caching, empty all cache and rebuild it. But, Safari still mantains older pages.
Also tried include some .htaccess rules and/or include (the old) “meta http-equiv=”pragma” content=”no-cache”".
Not seems look to work.
I guess that Safari doesn’t check on server for newer pages/caching, it is using local files… It’s that it?
In all other browser I have no problems (Firefox Mac and PC, Chrome, IE 7, 8).
Am I doing something wrong?
The site is http://www.caravanacopaorganica.com.br
Thanks for any help.
John – Brasil
Did you try doing a hard refresh on your Safari browser? Did you also trying accessing your site via a proxy in Safari, and see if that still shows old content?
Hello! Thanks for reply.
Yes, when I make a hard refresh, it works.
But, normal users don’t do this, they just visit the page.
That’s my worry…
I’m trying other configurations but, till now, no success.
Cheers
Hi
I followed your article to setup maxcdn and I did everything exept creating CNAME that my host support did for me. NetDNA test is passed but when I enable CDN from wp admin my blog shows only text not style and images.
I get 500 Internal Server Error for files with url of my cdn subdomain:
http://static.newbie.ir/wp-content/uploads/2011/02/Marble1.jpg
any idea?
Seems like that the CNAME is having issues. Sometimes CNAME records can take a while to propagate. You should try using the MaxCDN long link in W3 Total Cache, and see if that works.
After activating W3 Total cache, my WordPress admin panel went blank and I lost control over my admin dashboard.
Its only after when I deleted the Plugin and its associated files using FTP connection, I recovered my dashboard. I never had such a horrifying experience with any other plugin.
That’s what scares me about using plugins.
Especially complex ones like caching plugins.
I staying with a slow site.
ha ha! I feel your pain, and I’m very technical myself.
I tried all the cache plugins and did not even see that much improvement in speed, if any.
Weid, because I know the concept should work.
The best way to have a really fast site is to use a really fast server, VPS and a CDN and pay up.
Or get away from WordPress and use a static HTML+PHP type site and you will get page loads in the milliseconds even on cheap shared hosting.
W3 Total Cache allows you to integrate CDN with WordPress. WordPress is very well coded for performance. If it wasn’t the case, then many top brands like Sony, Wired and others would choose to go what you call “static HTML + PHP route”. The problem is not WordPress, it is the cheap shared hosting. WordPress runs great with caching on shared hosting accounts as well.
Those companies go with WP and other dynamic database driven site methodologies because they need it for the functionality they desire.
Not because dynamic database driven sites are faster than static sites.
I’m not even sure what your point was in your reply since it echoed basically what I said in my reply.
WordPress does not have a “problem” per se but how it works is simply slower. Every page request fires off a SQL database inquiry and then the page is assembled and then finally, delivered.
This is far slower than requesting a page and then having it returned. (typically milliseconds on just about any decent host)
This is what the cache programs are supposed to mimick but in practice, I did not see anywhere near this performance improvement.
Great post although I am not using any of the CDN’s listed. I have chosen to use the Google App engine free service for the time being to serve my CSS and javascript files.
i use wp super cache plaugin because its easy to use
do u recommend switching over to w3 total cache ? currently i use weekly theme by theme-junkie…..so if u could plz advice
Yes, W3 Total Cache is better. We made the switch, and we recommend it to all our users as well.