Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Speed & performance · Guide

How to Remove W3 Total Cache Completely (Step by Step)

How to Remove W3 Total Cache Completely (Step by Step)

Short answer

Empty all caches, then deactivate and delete W3 Total Cache from the Plugins screen. Next, remove any leftover advanced-cache, object-cache and db drop-ins in wp-content, the cache and w3tc-config folders, the W3TC blocks in htaccess and the WP_CACHE line in wp-config.

Key takeaways

  • Back up the site and empty all caches before removal.
  • Deactivation tries to undo the plugin's file and config changes.
  • Check wp-content for leftover drop-in files.
  • Delete the W3TC blocks in htaccess, not the WordPress block.
  • Remove WP_CACHE unless another cache plugin needs it.
  • Install only one page caching plugin afterwards.

How do you remove W3 Total Cache completely?

Empty all caches, deactivate and delete the plugin, then remove leftover drop-in files, the cache and config folders, the htaccess rules and the WP_CACHE line in wp-config.

W3 Total Cache does more than most plugins. It writes files outside its own folder, adds server rules and changes wp-config so caching starts early.

Deleting the plugin from the Plugins screen usually cleans up much of this. But leftovers are common, especially after errors, file permission problems or manual removal over FTP.

Those leftovers can break your site, slow it down or confuse the next caching plugin you install. A complete removal checks every place W3 Total Cache touched.

If you want background on what the plugin does, see our explainer on what W3 Total Cache is.

What files and settings does W3 Total Cache leave behind?

W3 Total Cache can leave drop-in files in wp-content, cache and config folders, rules in htaccess or Nginx config, a WP_CACHE constant and options in the database.

Here is the full list of places to check after removal.

LocationWhat W3 Total Cache addsSafe to remove after uninstall?
wp-content/advanced-cache.phpPage cache drop-inYes, if no other cache plugin uses it
wp-content/object-cache.phpObject cache drop-inYes, if not used by Redis or another tool
wp-content/db.phpDatabase cache drop-inYes, if no other plugin needs it
wp-content/cache/Cached pages, minified filesYes, W3 Total Cache subfolders
wp-content/w3tc-config/Plugin settings filesYes
.htaccessBlocks between W3TC markersYes, the marked blocks only
wp-config.phpWP_CACHE set to trueYes, if no other cache plugin needs it
DatabaseOptions starting with w3tcOptional clean-up

Open each location in turn. The sections below explain how.

What should you do before removing it?

Take a full backup, empty all caches from the plugin's dashboard, and note any CDN or Cloudflare settings it manages so you can handle them separately.

A backup lets you undo mistakes. Editing wp-config and htaccess by hand can take a site down if you delete the wrong line.

Then clear everything W3 Total Cache stored:

  1. Go to Performance, then Dashboard.
  2. Click Empty All Caches.
  3. If you used its CDN module, write down the CDN settings and purge the CDN.
  4. If you connected Cloudflare through W3 Total Cache, purge Cloudflare from its own dashboard too.

Cloudflare's guide to purging cached content shows the purge options. A stale CDN cache can keep serving old minified files after the plugin is gone.

How do you deactivate and delete the plugin?

Go to Plugins, deactivate W3 Total Cache, wait for the screen to reload, then click Delete so WordPress removes the plugin folder and runs its uninstall routine.

  1. Open Plugins, then Installed Plugins.
  2. Find W3 Total Cache and click Deactivate.
  3. Read any notice about files that could not be removed and write them down.
  4. Click Delete and confirm.

Deactivating is the important step. W3 Total Cache tries to remove its drop-ins, htaccess rules and wp-config change when it is deactivated.

If file permissions stop it, the plugin shows a notice with the files you must edit yourself. Do not skip that message.

The plugin's page on WordPress.org lists its modules, which helps you see which ones you used.

How do you remove the drop-in files?

Connect with FTP or your host's file manager, open wp-content, and delete advanced-cache.php, object-cache.php and db.php if they still exist and belong to W3 Total Cache.

Drop-ins are special files WordPress loads before plugins. If they remain after W3 Total Cache is gone, they may try to load code that no longer exists.

Before deleting, open each file and check its header comment. W3 Total Cache files mention the plugin by name.

Be careful if you use other tools. A Redis plugin, for example, uses its own object-cache.php. Only delete files that W3 Total Cache created.

If you need help reaching your files, see our guide on troubleshooting WordPress without admin access, which covers FTP and file managers.

How do you clean the cache and config folders?

Delete the W3 Total Cache subfolders inside wp-content/cache and the whole wp-content/w3tc-config folder, leaving other plugins' cache folders in place.

W3 Total Cache stores cached pages, minified CSS and JavaScript, and other data inside wp-content/cache. On busy sites this folder can be large.

Inside wp-content/cache, you may see folders such as page_enhanced, minify, object and db. These belong to W3 Total Cache and can be deleted.

Check the folder for other plugins' data before deleting it all. If W3 Total Cache was your only caching plugin, removing the entire cache folder is safe, as WordPress does not need it.

Then delete wp-content/w3tc-config. It only holds the plugin's settings.

How do you remove the htaccess rules?

Open the htaccess file in your site's root folder and delete every block between the W3TC BEGIN and END markers, keeping the standard WordPress block.

W3 Total Cache adds rules for browser caching, page caching and minify. Each block starts with a line like # BEGIN W3TC and ends with # END W3TC.

  1. Download a copy of htaccess as a backup.
  2. Open it in a plain text editor.
  3. Delete each section from # BEGIN W3TC through its matching # END line.
  4. Keep the # BEGIN WordPress section untouched.
  5. Save and upload the file.

The default WordPress rules are shown in the htaccess documentation on developer.wordpress.org. Compare your file with it if you are unsure.

On Nginx servers, the plugin may have written an nginx.conf file in your site root that your server config includes. Remove the include from your server config and delete that file, or ask your host to do it.

How do you remove WP_CACHE from wp-config?

Open wp-config.php and delete the line that defines WP_CACHE as true with a comment mentioning W3 Total Cache, unless another caching plugin needs it.

The line usually looks like this:

define( 'WP_CACHE', true ); // Added by W3 Total Cache

With WP_CACHE on and no advanced-cache.php file, WordPress simply skips the page cache. With the constant on and an old W3 Total Cache drop-in still present, errors can occur.

If you plan to install another page caching plugin, you can leave the constant. Most caching plugins set it themselves anyway.

The wp-config documentation explains where constants should sit in the file.

How do you clean W3 Total Cache options from the database?

Leftover options are harmless but can be removed with WP-CLI or phpMyAdmin by deleting rows in the options table whose names start with w3tc.

This step is optional. Old options do not slow down a normal site much, but some people like a clean database.

With WP-CLI, list matching options first:

wp option list --search="w3tc*" --fields=option_name

Then delete each one with wp option delete and the option name. The wp option command reference explains both commands.

In phpMyAdmin, search the options table for names starting with w3tc, back up the table, then delete those rows.

What if the site breaks after removing the plugin?

If the site shows errors after removal, a leftover drop-in or htaccess rule is usually the cause, so delete the drop-ins and restore a clean htaccess file.

Common symptoms include a white screen, a critical error message, missing styles or redirect loops.

Work through this list:

  • Critical error. Delete db.php and object-cache.php from wp-content.
  • Unstyled pages. Old minify rules in htaccess are pointing at deleted files. Remove the W3TC blocks.
  • Old content showing. A CDN or host cache still holds old copies. Purge them.
  • Redirect loops. Check htaccess for leftover rewrite rules.

If you cannot log in at all, our guide on fixing wp-admin not loading has general recovery steps that also apply here. MainWP has a separate walk-through on removing W3 Total Cache cleanly if you want a second checklist.

What should you use instead of W3 Total Cache?

Most sites replace it with one simpler caching plugin or with the host's built-in cache, and installing only one page cache avoids conflicts.

Popular options include WP Super Cache, LiteSpeed Cache on LiteSpeed servers and premium tools such as WP Rocket. Many managed hosts include server caching, so you may not need a plugin at all.

Install the new plugin only after the old files are gone. Two page caches can fight over advanced-cache.php.

Our comparison of page cache vs object cache explains which layers you actually need. After setting up the new tool, test your pages while logged out to confirm caching works.

Frequently asked questions

Does deleting W3 Total Cache remove all its files?

Not always. Deactivating and deleting the plugin normally removes most changes, but file permission problems or manual deletion over FTP can leave drop-ins, cache folders, htaccess rules and a WP_CACHE line behind. Check each location by hand afterwards.

Is it safe to delete advanced-cache.php?

Yes, if no other caching plugin uses it. Open the file first and check that it mentions W3 Total Cache. If you plan to install a new caching plugin, it will create its own version when you turn caching on.

Why is my site broken after removing W3 Total Cache?

A leftover drop-in such as db.php or object-cache.php, or old minify rules in htaccess, are the usual causes. Delete the drop-ins from wp-content, remove the W3TC blocks from htaccess and purge any CDN cache.

Should I remove the WP_CACHE line from wp-config?

Remove it if you are not using another page caching plugin. If you will install one, you can leave it, since most caching plugins need WP_CACHE set to true and add it themselves anyway.

Do I need to clean W3 Total Cache options from the database?

It is optional. Leftover options rarely affect performance, but you can remove rows whose names start with w3tc using WP-CLI or phpMyAdmin. Back up the database before deleting anything.

Sources

  1. W3 Total Cache WordPress.org
  2. Apache HTTPD and .htaccess WordPress Developer Resources
  3. wp-config.php WordPress Developer Resources
  4. wp option WordPress Developer Resources
  5. How to remove the W3 Total Cache plugin cleanly MainWP
  6. Purge cache Cloudflare Docs

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.