Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Install and Setup W3 Total Cache for Beginners

We often get compliments from users on how fast our site loads. Everyone wants to know the secret behind a fast loading WordPress site. Aside from good web hosting and well-coded plugins, you have to make sure that you’re using proper caching and have a CDN (content delivery network). For our setup, we use a plugin called W3 Total Cache. Due to a high volume of request, we have decided to create a step by step guide on how to install and setup W3 Total Cache for beginners.

In this article, we will show you how to install W3 Total Cache and set it up properly to maximize the benefits. We will also show you how to combine W3 Total Cache with a CDN service to make your site load even faster.

Before you begin, we highly recommend that you check performance of your site by using Google Page Speed and Pingdom Tools. This will give you a before and after comparison.

Below is the screenshot of our Pingdom results:

WPBeginner Pingdom November 21st

Lets get started with our setup of W3 Total Cache.

Video Tutorial

Subscribe to WPBeginner

If you don’t like the video or need more instructions, then continue reading.

What is W3 Total Cache?

W3 Total Cache is the fastest and most complete WordPress performance optimization plugin. Trusted by many popular sites including: AT&T, Mashable, Smashing Magazine, WPBeginner, and millions 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.

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. Search for “W3 Total Cache” and you should see results like the image below:

Installing W3 Total Cache plugin for WordPress

Click on the Install Now button and then activate the plugin.

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, these options could be quite tricky and confusing. We will visit each of these options in detail, so you can properly set up W3 Total Cache. Lets start with general settings.

General Settings

You can go to the General Settings page by clicking on the Performance menu button in your WordPress admin panel. This is where you will set up the plugin by configuring basic settings. Make sure that you’re on the general settings page and not the promotional Dashboard page that this plugin has.

W3 Total Cache General Settings Page

What is Page Cache?

The first option that you see on this page 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:

What is Page Cache?

As you can see normally when a user comes to your site, WordPress runs PHP scripts and MySQL queries to the database to find the requested page. Then PHP parses the data and generates a page. This process takes server resources. Having the page caching turned on, allows you to skip all that server load and show a cached copy of the page when a user requests it.

For shared hosting which most beginners use, the Disk:Enhanced method is highly recommended. You should check the Enable Page Cache box, and save all settings.

Setting up Page Cache in W3 Total Cache for WordPress

For most folks, this is all you need to do with page caching. Since this guide is for beginner level users we will skip the advanced settings of page caching because the default options are sufficient enough.

We will also skip through Minify, Database Cache, and Object Cache. The simple reason is because not all servers provide optimized results with these settings. Next option you will see is Browser Cache.

What is Browser Cache?

Every time a user visits a website, their web browser downloads all the images, CSS files, JavaScripts, and other static files in a temporary folder to enhance the user experience. This way when the same user goes to the next page, it 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 under Browser Cache option and click Save all settings button. Once you have done that, then lets visit the Performance » Browser Cache page for more settings.

Setting up Browser Cache options in W3 Total Cache

As you can see in the image above, we pretty much enabled everything except for the 404. When you save the settings, all settings below on that page will automatically take care of itself.

In our free WordPress setups, these are the default settings that we turn on.

What is a CDN?

CDN stands for Content Delivery Network which allows you to serve your static content from multiple cloud servers rather than just one hosting server. This enables 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 site. We highly recommend that you check it out, so you can make an educated decision.

W3 Total Cache supports MaxCDN, Amazon S3, Rackspace Cloud, and Amazon Cloud Front. WPBeginner is using MaxCDN (why we use 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.

First thing you need to do to is create a Pull Zone in your MaxCDN dashboard. Log in to your MaxCDN account, click on Manage Zones and then click on Create Pull Zone button.

Configure W3 Total Cache - MaxCDN Settings

On the next screen you will be asked to provide details for your pull zone.

  • Pull Zone Name: Simply give any name to this pull zone so that you can identify it in your MaxCDN panel.
  • Origin Server URL: Enter your WordPress website’s URL starting with http:// and ending with a trailing slash / at the end.
  • Custom CDN Domain: enter any subdomain, for example: cdn.wpbeginner.com
  • Label: Provide description for this pull zone.
  • Compression: Enabling compression will save you bandwidth so it is highly recommended that you check this box.

A screenshot of how the above mentioned settings will look like:

MaxCDN Pull Zone Details

Click on the Create button and MaxCDN will create the Pull Zone. On the next screen, it will show you a URL like this one “wpb.wpbeginner.netdna-cdn.com” copy and save this URL in a text file using notepad because we will need this later.

Now that we have created a Pull Zone, the next step is to set up content zones. You can do this by going to your MaxCDN dashboard. Click on the manage button next to your pull zone that you just created. On the next screen, click on the Settings tab. The purpose of creating content zones is to add subdomains, so that we can improve user experience by queuing content from different subdomains into user’s browser. To do this click on the button labeled Custom Domains and add multiple subdomains. See the screenshot below:

MaxCDN Multiple Subdomains

Once you have added custom domains simply click on the Update button.

The next step is to set up CNAME records for the subdomains. Most of our recommended WordPress Hosting providers such as Hostgator, Bluehost, etc provide a cPanel to their clients to manage different settings of their hosting. We will describe how to set up a CNAME record in cPanel.

Log in to your cPanel dashboard and then click on Simple DNS Zone Editor under Domains.

Configure W3 Total Cache - Adding a CNAME Record

On the next screen you will see a form with two fields. Enter the subdomain name you entered while creating the content zone. For example you will put cdn for cdn.wpbeginnner.com.

cPanel will automatically fill in the full domain. In the CNAME field enter the URL provided by MaxCDN when you created the pull zone. It is the URL we asked you to save in notepad.

Configure W3 Total Cache - Adding a CNAME Record

Repeat the process for all your subdomains, e.g. cdn1, cdn2, etc. Remember that only the name field will change each time and the CNAME field always have the url provided by MaxCDN for your pull zone. Once you have created CNAME records for all subdomains, it is time to go back to WordPress and setup MaxCDN with W3 Total Cache.

Go to Performance » General Settings. Scroll down till you find CDN configuration box. Check Enable and select MaxCDN from CDN Type drop down menu. Click on Save All Settings button.

Enabling MaxCDN in W3 Total Cache

After saving settings you will see a notification informing you to provide information for “Authorization Key” and “Replace default hostname with” fields and select a pull zone. Click on “Specify it here” link and W3 Total Cache will take you to the CDN page.

W3 Total Cache specify settings for MaxCDN

On the next screen click on the Authorize button. This will take you to MaxCDN website where you will generate an authorization key. Copy and paste this key back in W3 Total Cache. In “Replace site’s host name with” enter the subdomain you created earlier.

Entering MaxCDN API key and setting up hostname in W3 Total Cache

Save all settings and that’s all. Your site is now configured to serve static files using MaxCDN. 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:

https://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 that 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:

Advance CDN settings in W3 Total Cache

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 from your MaxCDN dashboard.

Everything that we have covered up till now, will work great on most web hosting accounts. However, W3 Total Cache comes with many other options. We will try our best to explain what they are, and 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 can be more resource intensive then the resource it will save. We are not saying that it is a horrible function. We are simply saying that it might not be the best fit for every server. 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, ignore it.

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.

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 works 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).

If you have any questions, then please feel free to ask in the comments below.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

159 CommentsLeave a Reply

  1. Hello,

    I’ve a question:

    Does a free version slow the website ? My opinion is that a free version of this plugin makes website slow.. how do you think?

    • The free version of plugins will not slow down your site, poorly coded plugins can slow down your site.

      Admin

  2. Thanks for the valuable tips,

    I would like to ask if it’s possible to update the article with the latest version of the plugin.

    Thanks in advance

  3. I enabled Minify settings in W3 Total cache plugin and also installed cloudflare extension in w3 total cache plugin.
    Should I enable minify settings in Cloudflare extension also?

    • You would want to only use one or the other, if your W3 Total cache minification is working well then stay with that for the moment :)

      Admin

    • It is not required but it is recommended to use a caching plugin with your CDN

      Admin

  4. This post is much outdated now, please update this post to the latest W3 total cache plugin.

    Thanks.

    • Thank you for letting us know about this post being outdated, we will update this article as we are able :)

      Admin

  5. Thanks for the great article! I really benefitted from it and have a better performance now 1/4 load time. One thing you should mention is in the Browser Page under Performance tab there is a box at the bottom that says Rewrite URL. Don’t check that it ruined my pages. All links were alterred but I took it off and it’s ok.

    • Thanks for your very easy to follow tutorial (with screenshots) on W3 Total Cache. I noticed an immediate difference in load time of the site.

  6. Hi, As per your recommendation, I have decided to go for MaxCDN, Is there any new update about CDN? Going to the MaxCDN site, there are different service including Content Delivery Network, Edge Delivery and other. Can your recommend me which service I have to select initially? I have new blog with no affiliate link till now and not planning for the next six month. And I am planning to apply Google adsense in the near future.Presently I installed WP Super Cache.
    Do I need to switch W3 Total Cache to configure with MaxCDN? if I can configure MaxCDN with WP Super Cache, do you have any guideline?

  7. Hey:)

    Thanks for those detailed instructions and I must say that you helped me much in setting up W3TC for my website..

    I have a small issue with W3TC.. It is not purging my feed cache even though I have enabled this in the Purge Policy..

    Will you help me how to solve this issue?

    Thanks in Advance

  8. After following this guide, I get the error: “Error: Empty hostname / CNAME list.” I have filled the “Replace site’s hostname with:” with all my cdn.* fields. Has anyone ran into this issue?

  9. I am Using W3 Total cache plugin for WordPress. My post has one table which updates every minute/hour. But as I do caching, the server does not serves latest version, instead it displays cached copy to the visitor. How can I purge cache every 30 minutes automatically so that it shows latest version of the post at after every 30 minutes?
    I have already tried inserting this code in functions.php file but its not purging cache every 1h, instead it dies 2-3h later.

    function w3_flush_cache( ) {
    $w3_plugin_totalcache->flush_all();
    }

    // Schedule Cron Job Event

    function w3tc_cache_flush() {
    if ( ! wp_next_scheduled( ‘w3_flush_cache’ ) ) {
    wp_schedule_event( current_time( ‘timestamp’ ), ‘hourly’, ‘w3_flush_cache’ );
    }
    }

  10. Thanks for such an easy to follow article. I broke my website yesterday using instructions from another blog. I should have come here first!!

    I am a bit surprised by my results though. I did a Pingdom and GT Metrics test before I made all these changes and my page load time was:
    Pingdom: 8.91 secs and GT Metrix: 5.3 secs

    After I made all the changes I re-ran the tests:
    Pingdom: 9.51 secs and GT Metrix: 9.9 secs

    I thought my load times were meant to get much better – not worse!!?? What have I done wrong?

  11. Thank you for so great content.
    Should I enable “Page cache” option in the process of development of site or only at when I launch it?
    For me it is convenient to do this right now, but I think maybe during development it is not good as I visiting thousand times to check the progress.

  12. Hi! Trying to install the W3 Total Cache Plug In, and while it says it is compatible with my version of WordPress, it says that the plug in is unavailable and says “Not allowed on our system due to performance, security or compatibility concerns. Please contact support with any questions.”
    First of all… do you know why this is no longer working? And, do you have an alternative cache plug in that you recommend? Thank you!

    • Hi Jessica,

      This means that your WordPress hosting company doesn’t allow the plugin. Most probably because they have their own caching solution integrated into your hosting account which doesn’t work well with W3 total Cache. Please contact your hosting provider for more details.

      Admin

  13. Hi, I need some help please.
    I’ve followed the instructions to serve my static files through CDN (and they’re very clear, thank you) and have found the process straightforward so far- but when I log in to my site the URL still starts with ‘www.’ and not ‘cdn’ so I guess cdn is not operational yet.
    One thing I notice is that in the MAXcdn account page there is no option to ‘Update’ the Custom Domain settings as mentioned in the instructions – is this OK? I assume it now updates automatically?
    But my main problem is that, assuming I now have to do this, I don’t know how to specify the static files in the custom files list in the custom setting of W3Total Cache. Help please. How should I fill in this Advanced panel – it’s now getting a bit too techie for me? Thank you.

    • Hi Andy,

      You will login to your WordPress site using the normal URL. CDN only serves static files via their network not the whole website.

      MaxCDN settings may have changed, but you would still need to setup your domain. Please contact their support and they will be able to guide you.

      Admin

  14. Hi Very helpful and useful article. I set w3 total cache as per above instructions and could see it improved my website speed in good level. I ‘ll use MaxCDN instructions …Thank you so much

  15. Hello Team! I am following your blog since long now and trust have learnt a lot. Thanks.

    I need a little bit of help – Mine is a startup site, but have started with Cloud VPS Server with Data Centre located in Mumbai, India. 2.80*4 CPU and 8GB Ram is the part of Server Configuration. For better Site Security and Performance what should i use – Cloudflare (If cloudflare then free or paid plan) or Sucuri, W3Total Cache, WP Super Cache, Varnish Cache or Some other plugin/software.

  16. I have an issue with this plugin , when I trying to update this plugin it failed and after fails when I Refresh my wordpress site .
    It says under maintenance come back after few hours.
    So I leave and came back after few hours but after few hours when I try to open my site .
    It’s Totally blank , Nothing is show on my Site.
    Only white page comes when I Try to open.

    So now what should I do ?

    Please help me…

  17. Thank you so much! I was about to go pay an extra $15 a month for cloud based hosting because my blog had gotten so slow at times it was unbearable! I had setup W3 Total Cache and just enabled everything.

    I didn’t recognize it until going through your guide, but this was the main reason my dashboard and WP console was taking FOREVER to do anything. Sometimes I would wait 20-30 seconds just to create or save a post. Now it is like 2-3 seconds at the max. Also, my site loads even faster with a lot of that junk turned off.

    I am on a shared hosting plan, and I guess all of the caching was actually bottlenecking the CPU or something…. Anyhow, thanks for such a useful guide!

  18. Dear sir,

    I use your guide with w3 total cache but facing the issue of rendering CSS file. This is link of my blog How its work

    Can I use Cloudfare with subdomain CDN ? Is it speed up loading time?

  19. Hi, I have a problem with My yoast sitemaps not rendering. A blank screen appears when I click it. My question is should I include or exclude Sitemap.xsl file in custom file settings in CDN?
    Kindly advice.

  20. Hello , I’m using w3 Total Cache on multisite wordpress … I want to exclude certain site from being excluded
    mysite.com/ms/
    mysite.com/ms/2/
    mysite.com/ms/3/
    mysite.com/ms/4/
    mysite.com/ms/5/
    mysite.com/ms/6/
    I want to exclude the whole mysite.com/ms/4/ site from being cached
    and what about exclude caching of certain plugin on mysite.com/ms/5/
    Help me Please :)

  21. I did the settings of W3 total cache plugin and the favicon of my website stopped appearing. Can you please check it

  22. I downloaded plugin and now its loading slower.

    Each time I test in pingdom the % faster than other sites decreases.

    Its only a 1 page site at this time.

  23. I recently set up W3 Total Cache with the Rackspace Cloud Files CDN. It all works, but I had expected the media files in the wp-content/uploads folder to only be posted in the CDN rather than on the server. Instead, media uploads now go to both the CDN AND the wp-content/uploads folder. Is this what is supposed to happen? It seemed unnecessarily redundant to me.

    • Yes, but the images on your server are stored so that you can end using CDN service anytime you want, or move to another service, or to create backup using WordPress backup plugins. However, your visitors will be served images from the closest CDN server instead of your site.

      Admin

  24. Hi,

    Are you still using maxcdn on this site? I’m trying to decide between maxcdn and keycdn. I noticed this post was from a few years ago and wondered if your thoughts about maxcdn are still the same?

    Thanks

  25. Superb site you have here but I was wondering if you knew of any forums that cover the same topics discussed in this article? I’d really like to be a part of group where I can get feedback from other knowledgeable individuals that share the same interest. If you have any suggestions, please let me know. Bless you!

  26. Hi ! I installed yesterday Super Cache because it seemed easier to configure than W3 Total Cache but this morning my site was very very very slow… So I decided to follow your tutorial step by step and change plugins.
    So, the first step was to deactivate the first plugin, so I clicked deactivate Super Cache and my whole site crashed !!! I get this message : 503 SERVICE UNAVAILABLE no server is available to handle this request.
    I don’t know what to do. Can you help ?

  27. Minify via disk is currently disabled

    I tried to check the box and when I save after the refresh, it’s disable. enabling it 100 times over still results in an unchecked box, and the message “Minify via disk is currently disabled. Anyone know how to fix that ?
    Thank you

    Reply

  28. Thank your this tutorial. I have used it for a couple of my sites.

    One thing, which might be a “duh” situation… But, I had my site in “Maintenance Mode” using SeedProd’s Coming Soon Pro. I did not see the CDN in front of the image urls until I turned off maintenance mode. Then, when I turned it back on again, they were gone again.

    Just in case someone needs this information :-)

  29. hi there, thanks for making this post for wp beginners. i’m also using wp total cache plugin for . could you help me or check my website what is problem in this becasie i’m not getting hits pls help me a humble request to u
    thanks

  30. Hello,
    I appreciate so much, your posts. They have helped me learn a bit about setting up my website. However, this particular post led me to check a bunch of boxes under”Performance » Browser Cache” that took me from faster than 91% down to faster than 71% on speed. I had checked them just as you have in your picture above. I unchecked all your suggested boxes and got back to 84%. (on Pingdom) This was the only change I made. I don’t understand why it made things slower, or why I couldn’t get back to my original speed. If you could explain this I would appreciate it. Thanks.

    • A lot of reasons can show you conflicting results when you are expecting something different. For example, you may have forgotten to save plugin settings, your server is particularly under heavy traffic at that time. Make sure you enable gzip compression as we have shown above, then test.

      Admin

  31. I am not using this cace plugin anymore. Using now wpfc two of my site. simple and faster then other plugins.

  32. Thanks for the tutorial…really helpful
    However my website is slower then before.

    I also have these performance issue “Remove query strings from static resources”.

    I haven’t enabled database caching and Minify as per your insutrctions as yet…also don’t have CDN service.

    before my website was faster.
    Any thoughts?
    Thanks
    Tea

    • How are you checking your website speed and performance? We recommend testing with pingdom using different locations. If it is still slow, then try resetting the plugin and follow the setup instructions again.

      Admin

      • yes using pingdom to test and speed is 2.55s…I think we can do better :)

        All my performance scores are 100 or 95 the lowest, but the “Remove query strings from static resources” is at 12.

        Any suggestions?

        Many thanks
        Tea

  33. This has to be one of the best if not the best WordPress learning sites ever! Detailed and very easy to understand modules. Thank you for all your hard researched work.

  34. THANK YOU FOR MAKING THIS! I’m EXTREMELY cautions on the plugins I install from horror stories. I’ve also heard horror stories about this very plug in. Therefore, I research as much as I can: tutorials, forums, reviews, troubleshooting etc. I am going to follow your tutorial exactly. My server says my site is too large, 500kb, and needs to be gzipped. [sigh] Another plugin to search.

    Helpful note: You may have a downloadable instructions on your site somewhere & I am not see it. But It would be helpful if I could download to print OR this was print friendly. you have have link but I am not seeing it.

    –Penny

  35. When I check the box for enable for page cache and click save all setting it doesn’t stay checked. Help please?

  36. Please Inform That if Enable Object Cache is checked may cause very slow or accessible admin panel after some times as happened to me and i have to disable object cache and after that i have no problem with this Great plugin

    TnX for your tutorial too

  37. Thanks for sharing . I tried to install W3 total cache showing Error not Available for you. How to fix it. Please help me

  38. i always come back for W3 Super Cache settings after messing-up with the plugin and i never back or restore its settings :P because i know where to look for it.

    Thanks Wpbeginner for this awesome tutorial.

  39. Many thanks for this really detailed step by step guide. I’ve installed google adsense along with a couple of other plug ins and my load time seems to have almost ground to a halt. I’ve installed Total Cache which has helped a little but I’m not sure what to do next. I’ll keep looking!

  40. I have one question that as we know that when we open any new website then browser cache it so then why we need any plugin for improving cache performance?

  41. Hello WPB team,
    I have connect MAxCDN by following all the guidlines as suggested in the article. But after some days my 99% images de-indexed in Google. Please is there any tutorial to FIX this? Will be very thankful to you for the help.

    Thanks

  42. Hi,

    I do have one question, when static pages are created for example you have 200 pages and just installed and set up W3 cache. So now when static pages will be created for all those 200 sites.
    Do you have to load it manually every site by site in your browser ? I understand that this action takes some time so when exactly those sites are created ( static copies on a disk) ?

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.