Why You Need to Disable W3 Total Cache via FTP
W3 Total Cache (W3TC) is a powerful optimization plugin, but it is also one of the most intrusive. It modifies your server’s .htaccess, wp-config.php, and adds several drop-in files to your /wp-content/ directory. If a setting conflict occurs—such as a minify error or a database caching loop—your site may crash, showing a “500 Internal Server Error” and locking you out of your WordPress dashboard.
Since you cannot log in to click “Deactivate,” you must manualy strip the plugin’s hooks from your server using FTP or a File Manager.
Step-by-Step: Completely Disabling W3 Total Cache via FTP
1. Rename the Plugin Folder (The Primary Kill-Switch)
- Connect to your site using an FTP client (like FileZilla).
- Navigate to
/wp-content/plugins/. - Locate the
w3-total-cachefolder. - Rename it to
w3-total-cache-old.
Why this is different: For most plugins, this step is enough. But W3Total Cache is “sticky.” Even with the folder renamed, the files it left behind in other directories can still crash your site. That’s why the next steps are critical.
2. Remove W3TC Drop-in Files (The Hidden Culprits)
W3TC places “drop-in” scripts directly into the /wp-content/ folder to intercept WordPress at the earliest possible stage. These must be manually deleted to stop the error.
- Navigate to your
/wp-content/directory. - Delete the following files if they exist:
advanced-cache.php(This is the most common cause of the “500 Error”)db.phpobject-cache.phpw3tc-config(Delete this whole folder)
Pro-Tip: Clear the “Sticky” Cache
Sometimes, even after deleting the files, your hosting server or CDN (like Cloudflare) might still be trying to serve the “broken” version of the site. After following these steps, always purge your CDN cache to ensure you are seeing the live, un-cached version of your site.
3. Clean Up wp-config.php
W3TC adds a line to your core configuration file to enable its caching engine.
- Find
wp-config.phpin your root directory. - Open it for editing.
- Look for the following line (usually at the very top):
/** Skip this line if you don't see it **/ define('WP_CACHE', true); // Added by W3 Total Cache - Change it to
falseor delete it entirely.
4. Revert .htaccess Changes (Optional but Recommended)
W3TC adds hundreds of lines of code to your .htaccess file for browser caching and compression. If your site still doesn’t load, this is likely the reason.
- Open
.htaccessin your root directory. - Look for the block starting with
# BEGIN W3TCand ending with# END W3TC. - Delete everything between those two markers.
- Save the file.
Using Terminal (WP-CLI) for Rapid Deactivation
If you have SSH access, you can perform these steps much faster:
# Deactivate the plugin
wp plugin deactivate w3-total-cache
# If the site is still broken, force delete the cache files
rm wp-content/advanced-cache.php
rm wp-content/db.php
rm -rf wp-content/w3tc-config
How to Verify the Fix Worked
- Check Site Headers: Visit your site and check the “Page Source” (Ctrl+U). Search for “W3 Total Cache.” If the plugin is disabled, the comment “Performance optimized by W3 Total Cache” should be gone from the bottom of the page.
- Access Admin Dashboard: You should now be able to log in to
yourdomain.com/wp-adminwithout errors. - Check Dashboard Notices: Once logged in, you may see a warning saying “W3 Total Cache could not find advanced-cache.php.” This is normal and confirms the manual removal worked.