Uninstall W3 Total Cache – The Proper Way

A few days ago I began the process of removing W3 Total Cache from all my blogs and replacing it with Quick Cache WP Super Cache. Why, you might wonder, would I do that. The simple answer is that W3 Total Cache conflicted one too many times with other plugins. I’m getting old and tired and I’m fast coming over to the idea that if a plugin’s too much hassle to setup then it shouldn’t call itself a plugin so much as it should call itself a nail in sanity’s coffin.

You’d expect it to be easy to remove W3 Total Cache. And it should be but it hooks its tentacles into a blog’s htaccess file, sticks multiple files into the blogs wp-content directory and, after removal, Google persistently requests (no longer existent) cached minified CSS files. All in all, it’s a bigger pain than being kicked in the ass by a galloping donkey on steroids.

In general, once setup, W3 Total Cache can be left to cache WordPress blog posts and pages faultlessly without any human monitoring but it gets temperamental when new plugins are installed, especially ones that use Javascript when W3TC is configured to minifi Javascript. If you use W3TC and you find some newly installed plugins fail to work or they bring down your whole site then you can almost guarantee the fault is with W3TC. Ditto if plugins work for logged in users but not for logged out visitors.

Removing W3TC is a bit of an art. For one, you will need to find an adequate replacement for it. I’ve moved over to Quick Cache WP Super Cache and I’m very happy with it. I’ve performed no speed tests and no server load tests to compare it with other cache plugins but I can say that, to me at least, most of the sites I’ve installed it on feel faster and more responsive than when they used W3 Total Cache. Sites hosted on my home server now load instantly with W3 Total Cache where as they took a second or two with W3TC.

Removing the Monster

Important: keep the plugin enabled until told to disable it. If you’ve already disabled and deleted W3 Total Cache then I suggest you re-install it and re-enable it then follow these instructions to properly remove it.

  1. Make sure the latest version of W3 Total Cache is installed
  2. Ensure your htaccess file has its permissions set to at least 644
  3. Ensure wp-config.php has its permissions set to at least 644
  4. Enter W3TC’s General Settings panel (Performance>General Settings)
    • Disable all caching
    • Run through the list of enabled caching types and untick “Enable” for each and every one of them
    • At the bottom of the General Settings page is a Miscellaneous section, untick everything in it
    • Click “Save All Settings”
  5. At the top of the screen, in red writing, you will now see that it says “The plugin is currently disabled”.
  6. Go to your WordPress plugins panel and find W3 Total Cache (Plugins>Installed Plugins)
    • Deactivate W3 Total Cache
    • Delete W3 Total Cache.
  7. Browse your site’s root directory with either an FTP program or your host provided file manager and enter the directory “wp-content” then delete the files (if they exist)
    • w3-total-cache-config.php
    • db.php
    • advanced-cache.php
  8. Still in the wp-content directory, delete the directory “w3tc” and all its content
  9. Check the site’s .htaccess file has no W3TC re-write rules in it
  10. Finally, unless you want to install a new cache plugin, open the site wp-config.php file and change the line that reads

    to

I would love to advise you on which WordPress cache plugin is best but that’s a server and site-by-site dependent issue. What works well for one site on one server will not work well for all sites on the same server or on different servers. Saying that, WP Super Cache is pretty good.

Resources & Links

WP Super Cache

List of WordPress cache plugins at sixrevisions.com

Update 7th June 2012

Since writing this post I have switched from Quick Cache to WP Super Cache. Over the past few months, both WordPress and my host’s server environment have been updated; Quick Cache hasn’t and it appears to have lost performance. I now advise WP Super Cache over Quick Cache.

Update 31st October 2012

I no longer recommend Quick Cache as a replacement for W3 Total Cache. I use WP Super Cache which works great. Install WP Super Cache, enable it then click the ‘Advanced Settings’ tab. Configure it to use htaccess rewrite rules, tell it not to cache RSS feeds and select all recommended settings.

Quick Cache will cease to be supported by its developers after 2012 ends.

Comments

    • says

      I took a look at it. Thanks for the suggestion but It seems like a lot of work to get a plugin working. Saying that, I didn’t install it, I only looked at the download page.

    • Anonymous says

      Actually for 75% effectiveness, just download and activate it. The rest is for tweaking.

  1. Sjoerd says

    Setting the wp-config.php to 700 made my site + admin go http error 500… Not knowing this was the cause I messed things up even worse… When I finally found out this was the cause (by adding php_flag display_errors on  to the .htaccess file in the root), I was too far gone and had to go reinstall the whole website from scratch……

    But what I don’t understand even now is, why does the wp-config.php needs other permissions than the 644 it has? It’s not like it’s going to be altered when w3tc is being removed.

    • says

      I’m sorry to learn that, Sjoerd, I would have helped you had you told me about it. Different servers are configured slightly differently so some permissions will give 500 errors. I’ll edit the post to prevent others doing the same.

      The reason I suggest changing the permissions of wp-config.php is purely out of security concerns. The file contains a website’s database login details. It’s a prime target for hackers looking for ways into a site. Hiding the file to everybody but the server makes it harder for a hacker to view it or download it.

      I usually use 400 or 440 for wp-config so that either my server is the only user that can view the file or those in the server group can view the file but no one in the world group can view it (people putting example.com/wp-config.php will not see the contents of wp-config.php).

      Some hackers access shared servers through insecure sites hosted on them. Once in, they can edit the wp-config.php file if its permission is set to 6xx. Ensuring it is not writable by the server is a preventative measure against hackers editing the file. Feel free to correct me if I’m wrong.

  2. Anonymous says

    Thanks !  I have also removed W3, although mine was easier, but I had to go delete the files mentioned by you.

    I also felt Quick Cache performs better, after all, it does the basics, which is all I need.  Being lightweight is good too.

    I’m getting old and tired too *lol*

  3. says

    Hi, Dion

    Thanks very much for writing this post. I’m pretty sure you just saved me some headaches down the track!

    I have no doubt W3 Total Cache works really well, but — as you say — if it conflicts with too many other plugins, etc. then you could argue it doesn’t work that well at all.

    But what would I know?

    Anyway, thanks for the removal steps. Worked like a charm!

    All the best,
    Leslie  

  4. Dean says

    Hi, I am uninstalling it as well, it keeps taking a lot my page content down and screwed up my themes as well which all was fine till using this W3 total cache this plugin is trash in my opinion. Thanks for the instructions

  5. Garry says

    I’m unclear about one of your steps above . . .   #9. “Check the site’s .htaccess file has no W3TC re-write rules in it”

    I don’t know enough to know which ones would be from W3TC.  Here is what I have:

    RewriteEngine OnRewriteBase /RewriteRule ^index.php$ – [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]Are this standard or from W3TC?Thanks.

  6. Mike says

    Excellent write-up! Thank you!

    I think I’m good to go except for the .htaccess-related stuff. I have the following in my .htaccess file (appearing above some 301 redirects that I would like to keep there).

    —-
    # BEGIN W3 Total Cache

        SetEnvIfNoCase Accept-Encoding (gzip) APPEND_EXT=.$1

        RewriteEngine On
        RewriteCond %{REQUEST_URI} /$
        RewriteCond %{REQUEST_URI} !(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register).php|wp-.*.php|index.php) [OR]
        RewriteCond %{REQUEST_URI} (wp-comments-popup.php|wp-links-opml.php|wp-locations.php) [NC]
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{QUERY_STRING} =””
        RewriteCond %{HTTP_COOKIE} !(comment_author|wp-postpass|wordpress_[a-f0-9]+|wordpress_logged_in) [NC]
        RewriteCond %{HTTP_USER_AGENT} !(bot|ia_archive|slurp|crawl|spider) [NC]
        RewriteCond /home/.pru/heffern/obliviousinvestor.com/wp-content/w3tc/pgcache/$1/_default_.html%{ENV:APPEND_EXT} -f
        RewriteRule (.*) wp-content/w3tc/pgcache/$1/_default_.html%{ENV:APPEND_EXT} [L]

    # END W3 Total Cache
    —-

    Is it safe to delete all of that?

  7. Mike says

    Update: I went ahead and deleted that from the .htaccess file after backing it up. Seems not to have caused any problems.

    There still must be something I’m missing though, because every time I try to save anything (a post, or page for instance), I get an error message:

    Warning: Cannot modify header information – headers already sent
    by (output started at
    /var/www/vhosts/obliviousinvestor.com/httpdocs/wp-content/themes/thesis_18/custom/custom_functions.php:1)
    in /var/www/vhosts/obliviousinvestor.com/httpdocs/wp-includes/pluggable.php on line 866

    • Mike says

      Update #2: Apparently that error was caused by accidentally entering a line break in a file that I had been checking for W3TC-related code. After deleting it, everything is peachy. (And all W3TC-related stuff seems to be gone as far as I can tell.)

      Thanks again for the helpful guide. :)

  8. says

    Just wanted to say that the latest version of W3 Total Cache seems very well-behaved; I had only to delete “w3-total-cache-config.php” — everything else was apparently removed by the uninstall process (deactivate and delete)!!

    Now I just hope my site works again…I had to take out W3 Total Cache due to conflicts with my shopping cart plugin!

  9. Dan says

    Thanks so much for this write-up. Worked like a breeze.

    Remember from an older site that unistalling W3TC drove me nearly insane.

    Now absolutely painless.

  10. Laurie says

    Thank you so much for this. I’ve been fighting with my W3TC configuration for several days, and finally gave up on it entirely this morning. Which, of course, is when the REAL fun began… trying to figure out how to remove it.

    To be fair, I think it’s important to say that W3TC is an extraordinary and powerful tool that works VERY well — PROVIDED you know what you’re doing. Which I didn’t. Nor do I have the time or inclination to invest in the learning curve. There are plenty of OTHER things I need to learn first, and every one of them is a lot more fun. I moved to WP Super Cache. 

    Thanks again.

    • says

      Very welcome Laurie. I’ve now moved from Quick Cache to WP Super Cache.

      When I wrote this post, Quick Cache worked perfectly well but it hasn’t been updated in step with WordPress, and I’m not sure what has happened (because I can’t be bothered to figure it out) but Quick Cache is no longer as efficient as it once was. WP Super Cache is easy to setup and doesn’t seem to have the issues W3TC has. I’m happy with it so far.

  11. Info says

    Well said, Laurie.  I’ve quit W3TC, came to Quick Cache, found it nice but wanting after some time, learned more about W3TC, and reinstalled.  I now have blazing speed for cached pages.  The best so far.

    • says

      I tried W3TC many times before I gave up on it completely. Doubt I’ll ever go back to it. I’m a happy WP Super Cacher now ;)

      Your suggestion for not using W3TC’s minify function is a good one. But W3TC’s developers know about its issues… That’s another reason I won’t return to it.

    • Laurie says

      Totally agree. I chose W3TC because I knew I wouldn’t grow out of it, and I suspect I’ll be back once my site is more mature. It was the minification that ultimately did me in. I had pretty much figured everything else out – lots of pain and suffering in the process, but it was educational and I was making progress, so I had high expectations. Then I moved on the minify part. At one point last night I had it all working perfectly. So I poured myself a nice adult beverage to celebrate. And THEN… I added a couple of CSS/JS heavy plugins. 

      Whereupon it all went south. I considered disabling just the minify feature and using something else for that function, but by that time I was so frustrated with the uncertainty of the process that I decided to chuck the whole thing in favor of an alternative that could better help me understand the concepts. I guess we really do have to walk before we can run… ;-) 

  12. says

    this is one of the worst mistakes i ever did as a webmaster installing this plugin that promised a lot and it did do some wonders however, compromised useful plugins. seriously its one of the worst wp caching plugins out there. thanks for the article it really helped    

  13. carlhays says

    Help!  After deactivating this plugin my site crashed with the typical ‘500’ error.  I then found instructions for removing all the files via ftp, which I did.  The 500 error persisted, so I then manually copied the W3TC files via ftp back into the proper directories, and still I’m getting the errors.  I’ve also removed every other plugin in my directory and still…nothing works.  Any ideas would be GREATLY appreciated.

  14. Dspilka says

    In addition to deleteing db.php and advanced-cache.php out of the wp-content directory, there is also object-cache.php. I believe this would have to be deleted as well because it is a file W3TC creates?

  15. lynn says

    thanks so much for taking the time to write this post! worked like a charm. TotalCache conflicted with Jigoshop cart. I found SuperCache to be much more user-friendly. If you’re not familiar with all the things w3tc offers, it’s a bit overwhelming.

  16. says

    Thanks for the detailed instructions Lee. I have removed WP Total Cache and installed WP Super Cache and Minify plugin. Things seem faster already. Thanks again, your article helped a lot.

    • says

      I won’t be recommending W3 anytime soon. Interesting, a lot of web hosts blindly recommend W3. They even install for people with resource spikes and leave the site admin to fix the errors it creates.

      Good choice to use Quick Cache but an even better choice is to use WP Super Cache. I’ve added an update to the bottom of the article to explain the best way to configure it. Quick Cache will not be supported by its developers after 2012 expires.

  17. Martin Cooney says

    Oh I couldn’t agree more in reference to plugin sanity.
    I battled for many months with W3 Total Cache, with little performance gain. Probably due to incorrectly setting it up.
    After research, I installed SuperCache and what a breath of fresh it was. Up and running in 30 mins and remarkably evident performance gains.
    SuperCache is certainly recommended, as far as I’m concerned. Good write up,

    • says

      In the old days, W3 cached pages would get indexed by search engines so deleting the cache caused 404 errors. Loads of them! Whether it’s still the same, I don’t know. I’ll not trust W3 again. Wish my clients would take my advice on that too but, hey, it’s more money for me when they ignore me and I have fix their sites for them. thanks Martin.

  18. says

    Hi Lee, THANK YOU so much for these instructions. I have followed them exactly with the exception of the .htaccess file. Every time I click to open it, I am asked do I want to ‘overwrite’ my local copy of this file, so I tell it no (I use Macromedia Dreamweaver MX 2004 to access my host server) and I immediately get this message – Can’t find a valid editor for this file extension.” So how can I open this file to check and see if this plugin did some re-writes that I need to remove? Thanks in advance for your help!

    • says

      Hi!

      You can remove those lines from wp-config.php. They will be added again by your next caching plugin.

      Windows doesn’t recognize dot files (files with names that begin with a ‘.’ like .htaccess). You can install an .htaccess editor plugin into WordPress. This will allow you to make changes to the file but it’s not the safest way. Another option is to log into your server’s control panel then use the file manager it provides.

      Hope this helps.

  19. says

    Thanks! The new W3TC upgrade was causing timeouts and was missing scheduled posts. Deinstalling it only partly worked and it mangled htaccess. This article help hugely

  20. Markus says

    Have been struggling with W3TC for a couple of days now. I get all kinds of weird error messages. The plugin wants access to my FTP, which I give it. It still complains that it hasn’t got permission to create and write to files in the wp-content directory. And all of a sudden it has changed the permissions of the wp-content directory. First to 051, which meant I could not even access it myself via FileZilla. Could not even browse my own website online, all I got was a blank page.

    Had to call my web hosting support so they could change the permission for wp-content back to what it was. Also, all my themes and all my other plugins were disabled in WP. WP was set to scratch!

    Tried to set things up again, and activated the W3TC plugin, and this time it changed the permission for the wp-content directory to 040. Again, WP was reset to scratch, none of my plugins or themes worked, could not access wp-content and my whole site was blank.

    Tomorrow, after calling the support once again to have them set the permissions correct, I will follow your instructions on how to get rid of this monster and NEVER use it again!

    • says

      Wow what an experience! I’ve never known W3TC do that before but I don’t put anything past it. The reason your plugins and themes wouldn’t work is that W3TC had set the wp-content directory permissions to not allow access to the plugin and theme files (they’re stored in there).

      As a suggestion, once you’ve removed W3TC, install Wordfence then use it to scan for malicious software. It’s possible something else is wrong with your site.

      Good luck removing W3TC!

  21. says

    Hello I found this post after a crash and burn deleting W3TC from a clients site, last time I do that thanks to this post, but I’m looking in the file manager and I removed the 3 you mention but I still have a couple of files “W3TC” W3TC-config” and “cache” should these all be deleted as well? I’m afraid to touch them after that mess I just encountered. Thanks for any advice.

  22. says

    I had a big mess and needed to remove it completely so I could go back to a previous version and your tutorial did the trick. My whole admin end had collapsed when I tried to upgrade. One site was fine; one was not…
    I really like the plug-in. I was able to raise my site scores on YSlow from a C and a D to a B but I know the new upgrade has caused some issues.
    Thanks

    • says

      There is another plugin called WP Minifi that works alongside WP super Cache but you need to be careful with WP Minifi because if it is incorrectly configured it can bring down a site in the same way W3TC does. If you use WP Minifi, check sliders work and check how the site performs for logged out users.

  23. says

    What about the /cache/ folder that sits in my wp-content directory? I can’t seem to delete or modify it without root access which I don’t have… is this a problem?

    • says

      It’s okay to leave that where it is.

      If you can’t delete it you will need to set the permissions on the directory (folder) to something like 777 so you can edit/delete it.

  24. Abe Li says

    Very helpful, thanks for sharing the tips. I have dumped W3C for WP super cache, a GTmetrix test shown super cache is much faster.

  25. Aralaya says

    I tried to follow the steps and deactivate the plugin – but it keeps giving ‘internal server error. How do I get rid of this w3 plugin menace

  26. Santo Clemenzi says

    Few minutes ago I just deactivated W3TC on my girlfriend’s blog…you know what? W3 was destroying blog performance…I can’t explain how it’s possible but simply deactivating the monster the site works better. I’ll monitor the blog and if it would be necessary I’ll try WP Super Cache. Thank you for this post!

  27. says

    Well, thanks a million for this tutorial. I managed to get this done, but there are a few more things to note:

    I also had a file in the wp-content folder called “object-cache.php” that had to go.

    W3 seems to finally be gone. Let’s hope Super Cache holds its ground.

  28. John says

    Wow, what a lifesaver, thanks so much for posting this! I was totally locked out of my admin, this lead me to the culprit.

  29. Bill says

    So far so good, your steps are easy to follow for a relative newbie.

    However I’m not sure about one of your steps above . . . #9. “Check the site’s .htaccess file has no W3TC re-write rules in it”

    I don’t know how to identify the rewrite rules from W3TC.

    The file has a section clearly labeled # Begin WordPress and # End WordPress.

    Below the WordPress stuff there are 22 RewriteCond rules all followed by [NC] and 1 Rewrite rule followed by [F,NC]. There is no # Begin or # End around them and no reference to W3TC in any of them.

    How do I know whether to delete them or not?

    Thanks, Bill

    • says

      They’re probably not from W3TC. Do you have any security plugins installed? Security plugins often edit the .htaccess file, though most reputable plugins mark out their edits with begin and end tags. Email me your .htaccess file’s content and I’ll take a look at it for you. My email address is leehodson -a.t – vizred.com. Thanks Bill.

  30. says

    Thanks. That was pretty helpful. I have switched to WP Super Cache and things are fine now. btw I realized while installing WP Super cache that the blank page issue could be because of the .htaccess file of cache folder that I deleted while debugging some issues of W3TC. Anyways I am not going back.

    Thanks again!

  31. says

    Thank you very much for posting these instructions!

    I recently switched from W3 to Hyper Cache Extended with the DB Cache Reloaded Fix, because with W3 each page load still resulted in about 160 database queries, while with the latter it is only 32.

    Yet getting rid of E3 was a huge headache, as deactivating and simply uninstalling it resulted in a home page that wasn’t updated anymore – it seemed as if the site was set to display an old cached version of it ad infinitum.

  32. says

    Worst thing I ever installed on my sites. Once installed it took Google hours to index my latest posts, whereas before installing Total Cache, they indexed almost immediately. Plus, when they did index with Total Cache, Google wasn’t indexing the description correctly. Deleted this terrible plugin and, voila, no problems :)

  33. says

    @Lee. Thanks again. I saw your comment about WP Minify. I did get W3 working again and use the minify there. I also have Cloudflare and have been thinking about using them to minify. Haven’t decided yet. Got my scores up to an A so I a leery to mess with it.

  34. Larry says

    W3TC was causing problems with some software that was installed on my site, rendering it useless. But I needed it. The software, not W3TC. I’m going with Quick Cache. It’s still being supported and was last updated 3 days ago. I use it on another one of my sites and had no problems with the new software. Anyway I hate Super Cache. Never know what settings to go with. Yes I know, recommended. But if you search a little everyone has their own recommendations. Phooey!

    • says

      Larry, thank you for the tip re Quick Cache (QC). Can see the developer has revived the plugin and released a $15 pro version. I’ve installed it here in JX to test. If the developer keeps up his good work then I will again begin recommending Quick Cache to my readers and clients. It is so easy for non techs to use.

      The QC Pro version even has a user specific caching option for use in membership sites; I am not aware of any other caching plugin with this feature. Amazing work.

      Thanks Larry!

  35. roam92 says

    Helpful post, thanks. You can add to step 8…

    Still in the wp-content directory, delete these two entire directories as well (if present):

    w3tc-config/
    cache/

    • says

      Thanks Roam92. I opted not to remove them in case the cache files were indexed by search engines. Probably is better to remove them but their removal would be a site-by-site choice.

  36. says

    Thanks for this, I actually installed W3 Total Cache on my site as an experiment when I was already running CloudFlare, which also acts as a cache. The site was a few seconds slower and it proves running two plugins essentially doing the same thing was overkill.

    Getting rid of W3 Total Cache has been tougher than I imagined!

  37. says

    After using w3 Cache plugin my permalink was change and I am not able to fixed it even after deleting w3 cache plugin now whenever I am going to open any page from any category its show 404 page please help me ?

    • says

      You guess you need to go to ‘WordPress Dashboard > Settings > Permalinks’ then reset your permalinks.

      Also, if you have a redirection plugin installed then that redirection plugin might be causing 404 errors.

Leave a Reply