advanced-cache.php in WordPress: What It Is + How to Remove a Cache Plugin Completely
advanced-cache.php is a small PHP file that a page cache plugin drops into your wp-content folder. WordPress runs it very early on every request, before most of WordPress loads, so the plugin can send a saved copy of the page instead of building it again. It only runs when WP_CACHE is set to true in wp-config.php.
That file, and the WP_CACHE line that switches it on, are also the two things most likely to be left behind when you remove a cache plugin. I installed and removed five speed plugins on the same test site in two evenings. WP Rocket writes define('WP_CACHE', false); into wp-config when you deactivate it, and an old copy of that line stopped WP Super Cache until I fixed it by hand. WP Super Cache left its own advanced-cache.php in place after I deleted it. W3 Total Cache needed an Nginx config file and an include line in my server block, and neither goes away when you delete the plugin.
Short answer
- advanced-cache.php is a WordPress drop-in: core loads it from
wp-content/whenWP_CACHEistrue. Only one can exist per site. - If no cache plugin is active, you can delete it. If a cache plugin is active, don’t; the plugin needs it (and will usually write it again).
- “WP_CACHE constant set to false” means an old plugin left
define('WP_CACHE', false);in wp-config. Change it totrue(or remove the line) before you activate the new cache plugin. - Removing a cache plugin completely = clear its cache, undo server rules (Nginx include or .htaccess), deactivate, delete, then check four places: drop-ins, wp-config,
wp-content/cache, and Redis.
How I tested: WP Super Cache 3.1, Autoptimize, WP Fastest Cache 1.5.5, W3 Total Cache 2.11.0 and WP Rocket 3.24, one after another, on fashionlookbd.shop (a noindex test site). WordPress 7.1.4, PHP 8.5, Nginx on an aaPanel VPS in Hong Kong (YottaSrc), Redis on the same server, Cloudflare proxied. Each cache plugin was cleared, deactivated and deleted before the next one went in (Autoptimize ran on top of WP Super Cache). 8 and 9 November 2026, tested from Dhaka. Cost: $0 (WP Rocket on its trial).
Between 10 and 12 November I removed FlyingPress 5.6.7, NitroPack 1.20.4, xSpeed Cache and Super Page Cache 5.3.10 from the same site the same way.
Table of Contents
What is advanced-cache.php?
WordPress has a short list of special files called drop-ins. They sit directly in wp-content/, not in the plugins folder, and they replace or extend a piece of core. advanced-cache.php is the one for page caching. Its neighbours are object-cache.php (a persistent object cache such as Redis) and db.php (a custom database layer).
During startup, wp-settings.php checks three things: is WP_CACHE true, does wp-content/advanced-cache.php exist, and has nothing filtered it off (the enable_loading_advanced_cache_dropin filter). If all three pass, the file is included right there, before plugins, the theme and most of the database work. A good page cache plugin uses that moment to look for a saved HTML copy of the requested URL and send it straight away.
That is why the file matters for speed, and why a broken one is so disruptive. On my test site, WordPress without any cache answered in 0.759 s (curl TTFB from Dhaka). With WP Super Cache serving pages through its advanced-cache.php, it was 0.27 s. If the file is missing or WP_CACHE is false, the plugin can still be active and look fine in its settings, but cached pages stop being served that early.
Two rules follow from this:
- Only one page cache plugin can own the file. There is exactly one
wp-content/advanced-cache.php. Whichever plugin wrote it last wins. - The file is not the plugin. Deleting a plugin from the Plugins screen does not guarantee the drop-in goes with it. That depends on the plugin’s own cleanup code.
Which cache plugins use advanced-cache.php?
Most full page cache plugins do. Asset optimizers that don’t cache pages, such as Autoptimize on its default settings, don’t. This is what each plugin I tested used, and what I found after removing it:
| Plugin | Uses advanced-cache.php | Other files it adds | Left behind on my server after delete |
|---|---|---|---|
| WP Super Cache | Yes | WP_CACHE and WPCACHEHOME lines in wp-config, wp-content/wp-cache-config.php, wp-content/cache/ | advanced-cache.php (deleted by hand) and the WP_CACHE line |
| WP Fastest Cache | None found (it serves from wp-content/cache/all) | wp-content/cache/all, wpfc-minified | tmpWpfc and wpfc-minified folders in wp-content/cache |
| W3 Total Cache | Yes (page cache) | object-cache.php, db.php, nginx.conf in the site root on Nginx, config folder | nginx.conf in the site root and Redis keys (the include line is yours to remove; I took it out before deleting) |
| WP Rocket | Yes | WP_CACHE line in wp-config, wp-content/cache/wp-rocket, wp-content/wp-rocket-config | define('WP_CACHE', false); in wp-config (its code also leaves an emptied advanced-cache.php; see below) |
| Autoptimize | No (default settings) | wp-content/cache/autoptimize | Nothing I could find (I cleared its cache first) |
FlyingPress, which webpickr.com runs on, also writes an advanced-cache.php. When I removed it from the test site, its cache folder stayed behind; that, Super Page Cache and NitroPack are in the leftovers section below. LiteSpeed Cache no longer creates this file at all (it stopped using it in version 7.4, August 2025).
xSpeed Cache is tidier: after I removed its Nginx snippet, both plugins and its cache/xspeed, cache/xspeed-static and uploads/xspeed folders, nothing of it was left in wp-config or Drop-ins, as I describe in my xSpeed Cache review.
How to check if your site has advanced-cache.php
You don’t need FTP to find out. There are four quick ways, from easiest to most direct:
- Plugins screen. If any drop-in exists, WordPress adds a Drop-ins link next to All / Active / Inactive. Click it to see which ones and what each does. No Drop-ins link means none are present.
- Tools → Site Health → Info. Open the Drop-ins section to see the files, and WordPress Constants to see the current value of
WP_CACHE. - File manager or SFTP. Look in
wp-content/(the same folder aspluginsandthemes). In aaPanel that’s Files →/www/wwwroot/yourdomain/wp-content/. - WP-CLI, if your host has it:
wp config get WP_CACHEprints the value of the constant (read-only, it changes nothing), andwp plugin list --status=dropinlists the drop-ins (also read-only). Run both from the site root.


Which plugin made it? Open advanced-cache.php in the file manager; the first few lines almost always name the plugin (WP Super Cache, W3 Total Cache and WP Rocket all label theirs). A 0-byte file is usually a leftover from a plugin that emptied it on deactivation. Site Health’s Page cache check (Status tab, WordPress 6.1 and later) also only counts a page cache plugin as present when the file exists and WP_CACHE is true.
“WP_CACHE constant set to false”: what it means and how to fix it
This was the first thing I hit. Before the session, the test site still had speed plugins from earlier tests, WP Rocket among them. When I installed WP Super Cache, its settings page showed this:

The message is accurate. An earlier plugin had left define('WP_CACHE', false); in wp-config.php. With that line in place, WordPress never loads advanced-cache.php, so WP Super Cache couldn’t serve anything from its cache.
I didn’t know which plugin had written it until the next evening. WP Rocket was the last plugin in the test. When I deactivated it, it wrote the same define('WP_CACHE', false); line into wp-config again.
WP Rocket’s own code does this on purpose: when you deactivate it, it rewrites the constant as define( 'WP_CACHE', false ); // Added by WP Rocket so its cache stops loading. It doesn’t put it back to true or remove it when you delete the plugin. WP Super Cache, for its part, will add a missing WP_CACHE line by itself, but it won’t change one that’s already set to false. That’s the whole chain.
The fix:
- Open
wp-config.php(in the site root, next towp-content) in your host’s file manager or over SFTP. Take a copy first. - Find the
WP_CACHEline. There should be only one. If you see two, delete the extra one, because PHP will warn about a constant defined twice. - Change it to
define('WP_CACHE', true);. It must sit above the line that says/* That's all, stop editing! */and therequire_oncefor wp-settings.php. - Save, reload the cache plugin’s settings page, and run its own cache test. On WP Super Cache that’s Easy → Test Cache; mine passed straight away.
If you’re not installing another cache plugin, you can delete the line instead. WordPress treats a missing WP_CACHE as false, which is what you want with no page cache.

A related warning from WP Super Cache: “The file /wp-content/advanced-cache.php already exists. Please manually delete it”. Same story, different leftover: another plugin’s drop-in is still in wp-content. If no other cache plugin is active, delete the file and let the new plugin write its own.
Is it safe to delete advanced-cache.php?
It depends on whether a page cache plugin is still using it:
| Situation | Delete advanced-cache.php? | What happens |
|---|---|---|
| No cache plugin active (you removed it) | Yes | Nothing breaks. WordPress just skips the step. |
| A cache plugin is active | No | Caching stops or the plugin shows a warning, and most plugins write the file again when you save their settings. |
| You’re switching cache plugins | Yes, after deleting the old plugin and before activating the new one | The new plugin writes its own version. |
| Site shows a fatal error that mentions advanced-cache.php | Yes, that’s the fix | The file is calling code from a plugin that’s no longer there. Deleting it brings the site back. |
Why it comes back: an active cache plugin rewrites advanced-cache.php when it’s activated or its settings are saved. If the file reappears after you delete it, a cache plugin is still active; the file’s first lines tell you which.
The last case is the one that sends people searching. Someone deletes a plugin’s folder over FTP, its uninstall code never runs, and the leftover drop-in still tries to load files from wp-content/plugins/old-plugin/. You get a white screen or a “failed opening required” error. Rename or delete wp-content/advanced-cache.php over SFTP or the file manager and the site loads again.
Deleting the file never touches your posts, settings or database. The worst case is that an active cache plugin stops serving cached pages until it writes the file again.
Is advanced-cache.php malware? How to tell
Usually not. advanced-cache.php is a normal WordPress file name, and on most sites a page cache plugin wrote it. Its presence alone proves nothing. But because WordPress loads it before any plugin, attackers also hide code under this name. What matters is whether an active plugin owns yours and what the code does.
This isn’t theoretical. In September 2026 Sucuri described a self-healing infection that used advanced-cache.php as an early loader to rebuild a fake plugin. A week earlier Wordfence wrote about a malicious must-use plugin and found that the most common file names in those infections looked legitimate, the advanced-cache.php and db.php drop-ins among them.
| Check | Normal | Suspicious |
|---|---|---|
| Who owns it | A page cache plugin is active, and its settings say caching is on | No cache plugin is active, and the file isn’t empty or a leftover naming a plugin you used before |
| wp-config.php | WP_CACHE is true because that plugin set it (WordPress only loads the file when it is) | WP_CACHE is true and you never turned caching on |
| Header and code together | The first lines name the active plugin and the code loads files from that plugin’s own folder | A plugin name in the header but code that loads nothing from that plugin (a name is easy to fake) |
| What’s inside | Readable PHP | eval, base64_decode, gzinflate, str_rot13, long strings of random characters, or web addresses |
| What it loads | Files under wp-content/plugins/plugin-name/ or its cache folder | Files from uploads, /tmp, or files with odd names or extensions such as .ico |
| After you delete it | It comes back only when the active cache plugin rewrites it | It comes back by itself, with no cache plugin active |
File dates are a weak clue: malware can copy the date of a neighbouring file. On my test server, each drop-in I opened named its plugin in the first lines, which is the baseline to compare yours against.
If yours looks suspicious:
- Don’t just delete it. Infections that use drop-ins often keep copies elsewhere and rebuild the file. Download a copy first, as evidence for whoever cleans the site.
- Check its companions:
wp-content/mu-plugins/,object-cache.phpanddb.phpin wp-content, any.user.iniwith anauto_prepend_fileline, admin users you don’t recognise, and unknown scheduled (cron) tasks. If.user.iniprepends a file, remove that line before deleting the file it points to, or every PHP request can fail. - Run a malware scanner from your host or a security plugin. With WP-CLI,
wp plugin verify-checksums --allcompares plugins from wordpress.org with the official copies (read-only, it changes nothing).wp core verify-checksumschecks WordPress core the same way but skips wp-content and wp-config.php, so it can’t vouch for advanced-cache.php. - Restore a clean backup from before the file appeared if you have one. Then change every admin password and the salts in wp-config, and update WordPress, plugins and theme.
- If the file keeps coming back, get professional cleanup. A rebuilt drop-in means part of the infection is still on the server.
How to remove a cache plugin completely (step by step)
This is the order I followed for every plugin in the test. Doing it in this order matters: some cleanup only works while the plugin is still active, and server rules need to go before the files they point to.
- Take a backup first. A full backup (files + database) from your host or panel takes two minutes and makes every step below reversible.
- Clear the plugin’s cache from inside the plugin. WP Super Cache: Contents → Delete Cache. WP Fastest Cache: Clear Cache → Clear Cache and Minified CSS/JS. W3 Total Cache: Performance → Dashboard → empty all caches. WP Rocket: Dashboard → Clear cache.
- Switch off anything that reaches outside WordPress. Turn off object cache (W3 Total Cache), and remove any server rules you added for the plugin: the
includeline in your Nginx config, or the plugin’s block in.htaccesson Apache. If you connected the plugin to Cloudflare, disconnect it there too. - Deactivate. Use the normal Deactivate link. WP Rocket offers a Safe Mode option in its popup; that’s for troubleshooting, not removal, so I used the plain Deactivate.
- Delete from the Plugins screen, not over FTP, so the plugin’s uninstall routine runs.
- Check for drop-ins. Plugins screen → Drop-ins link (or Site Health). If advanced-cache.php, object-cache.php or db.php is still there and nothing else uses it, delete it.
- Back up wp-config.php, then check it. Look for
WP_CACHE(set it to what your next plugin needs, or remove it) andWPCACHEHOME(WP Super Cache only; delete it). - Check
wp-content/cache/and any config folders the plugin made (for examplewp-rocket-configorw3tc-config). Delete only the folders named after the plugin you removed. - Optional: database leftovers. Some plugins keep options, tables or cron events after deletion (WP Rocket’s guide names its
wp_wpr_*tables, thewp_rocket_settingsoption and “rocket” cron events). They don’t affect caching. Remove them only with a fresh backup. - Flush the object cache if the plugin used Redis or Memcached. On a shared Redis server, flush only that site’s database (details below).
- Purge the CDN. If Cloudflare or another CDN cached HTML, purge it so visitors don’t keep getting pages built by the old plugin.
- Confirm it’s really gone. Load a page in a private window, view the source and look for the old plugin’s comment at the bottom, and check the response headers. My guide on how to check if WordPress cache is working shows what each plugin’s footprint looks like.
What each plugin left behind on my server
Same site, same order, same cleanup steps. Here is what was still there after Deactivate → Delete, before I tidied up by hand.
WP Super Cache: the drop-in stayed
I cleared the cache from Contents → Delete Cache, deactivated and deleted it. wp-content/advanced-cache.php was still there afterwards, and so was the WP_CACHE line. That surprised me: WP Super Cache’s code is meant to remove both on deactivation (its own notes only warn that .htaccess rewrite rules stay). On my server the drop-in stayed anyway, so I deleted it by hand. Don’t assume; check.

WP Super Cache also adds a WPCACHEHOME line to wp-config. Remove it too once the plugin is gone; on its own it does nothing, but it’s clutter that confuses the next person who opens the file.
WP Fastest Cache: two folders in wp-content/cache
I didn’t find a drop-in from WP Fastest Cache; it serves its cache from wp-content/cache/all. It did leave two folders, tmpWpfc and wpfc-minified, inside wp-content/cache even though I’d used Clear Cache and Minified CSS/JS before deleting it. They are just old cached files, safe to delete.

W3 Total Cache: an Nginx file, an include line and Redis
W3 Total Cache touches the most places, so it’s the one to slow down for. On Nginx, its Disk: Enhanced page cache doesn’t work with a plugin setting alone. W3TC writes its rules to an nginx.conf file in the site root and asks you to include it in your server config. It also shows a notice whenever those rules change:

I added the include in aaPanel (Website → site → Config file), right after the root line. Before and after:


Here’s the part that bites people. If you delete W3 Total Cache and its nginx.conf file but leave that include line, Nginx is now including a file that doesn’t exist. Nginx refuses to load a config with a missing include, so the next reload or restart fails. Depending on the panel, that means your config change won’t save, or Nginx won’t come back after a server reboot, and that takes down every site on the server, not only this one.
So I removed it in this order: switched W3TC back to Disk: Basic and turned off Object Cache, emptied all caches, removed the include line in aaPanel (aaPanel tests the config before saving, so a typo can’t take Nginx down), deactivated and deleted W3TC, then deleted nginx.conf from the site root. W3TC removed its own drop-ins and config folder. The one thing it didn’t touch was Redis.

WP Rocket: how to uninstall it completely (it leaves WP_CACHE false)
What it left was the one line that tripped up WP Super Cache at the start: define('WP_CACHE', false); in wp-config.
WP Rocket’s source (version 3.24) explains why: deactivation writes that line (only when the licence is valid) and empties advanced-cache.php rather than deleting it. The uninstall routine then removes wp-content/cache/wp-rocket, min, busting, used-css, critical-css, wp-rocket-config and its database tables, but doesn’t touch wp-config or the drop-in.
By the end of my session the Plugins screen showed no Drop-ins link, but I didn’t check the file between deactivating WP Rocket and that screenshot. So on your site, look for a 0-byte advanced-cache.php as well as the WP_CACHE line. WP Rocket’s manual uninstall guide lists the rest, including the # BEGIN WP Rocket block in .htaccess on Apache servers.

Fix the line as shown in the WP_CACHE section above. I also removed the test site from my WP Rocket account so the licence slot was free again.
Autoptimize: nothing to chase
Autoptimize optimizes CSS, JavaScript and images; on default settings it doesn’t cache pages, so it doesn’t write advanced-cache.php. I cleared its cache from the admin bar, then deleted it. Nothing was left in wp-config, and I didn’t find a drop-in. That’s also why it could run alongside WP Super Cache in my Autoptimize vs WP Rocket test without a conflict.
In the next sessions I removed four more page cache plugins from the same site. xSpeed Cache is covered above; the other three each left something:
FlyingPress: its cache folder
After Deactivate → Delete, wp-content/cache/flying-press was still there. It holds cached files only, so it’s safe to delete once FlyingPress is gone.
Super Page Cache: its cache folder
Super Page Cache left its wp-cloudflare-super-page-cache cache folder in wp-content. If you connected it to Cloudflare, also check in Cloudflare that the cache rule it created is gone.
NitroPack: another WP_CACHE false line
NitroPack rewrote the constant in wp-config as define( 'WP_CACHE', false /* Modified by NitroPack */ ); and left it there. That’s the same trap WP Rocket sets: the next cache plugin you install sees WP_CACHE set to false. Fix it the same way, set it to true for the new plugin or delete the line.
Don’t forget the object cache (Redis)
A page cache plugin that also does object caching, like W3 Total Cache, stores data in Redis or Memcached. Uninstalling the plugin doesn’t empty that. Old keys just sit there until they expire. On my server that’s a real problem: Redis is shared by several sites, it’s set to noeviction, and each site gets its own database number (the W3TC test used database 9, kept apart from my live sites’ databases).
So the last cleanup step for W3TC was flushing only database 9, from the aaPanel terminal:
redis-cli -n 9 dbsizecounts the keys in database 9. Read-only, changes nothing.redis-cli -n 9 flushdbdeletes every key in database 9 and nothing else. If your Redis has a password, add--askpass(redis-cli asks for it, so it isn’t saved in your shell history).
Never leave out -n: without it, flushdb empties database 0, which may belong to another site. And never use FLUSHALL on a shared server; it empties every database at once. If you used a separate object cache plugin (Redis Object Cache, or FlyingPress’s built-in one), it has its own object-cache.php drop-in; disable it from its settings first, then check the Drop-ins list. I covered the Redis side in more detail in my aaPanel Redis object cache guide.
Can you use two cache plugins at the same time?
Not two page cache plugins. There’s one advanced-cache.php and one WP_CACHE switch, so two plugins end up fighting over them: one overwrites the other’s drop-in, or each serves and purges its own copy of the same page and you get stale pages that won’t clear.
The vendors agree: WP Rocket’s documentation says outright that you can’t use two caching plugins at the same time, and WP Fastest Cache’s plugin page tells you to disable W3 Total Cache, WP Super Cache, WP-Optimize and others while you use it. WordPress core itself only loads one advanced-cache.php; the comment in its code says that’s because “you would only want one”. If you are deciding which single plugin to keep, see my tested ranking of WordPress cache plugins.
A page cache plus a plugin that only optimizes files is fine, as long as only one of them does page caching. WP Super Cache plus Autoptimize was one of my test setups: TTFB 0.24 s, PageSpeed mobile 100, and page weight down from 413 kB to 140 kB, with nothing broken. The things to avoid are the overlaps: both minifying the same CSS, both lazy-loading images, or both trying to talk to Cloudflare.
A server cache and a plugin cache also count as two layers. If your host already caches pages (Kinsta and WP Engine, for example), you often don’t need a page cache plugin at all; my cf-cache-status guide explains how to tell which layer actually served a page.
Switching cache plugins: a 5-minute checklist
If you’re replacing one cache plugin with another, this is the short version of everything above:
- Old plugin: clear cache, turn off object cache and server rules, deactivate, delete.
- Drop-ins list empty (or only the ones you still use).
WP_CACHE: no line, or one line set totrue. NoWPCACHEHOME.- Old folders in
wp-content/cachegone; Redis database flushed if one was used. - Activate the new plugin, then check the page source and headers for its footprint, not the old one’s.
I switched page cache plugins four times on the same site. Each new plugin worked first time once the old one’s leftovers were gone. Those same-site results are in my comparisons of WP Rocket vs W3 Total Cache and WP Rocket vs WP Fastest Cache.
advanced-cache.php errors and other problems after removing a cache plugin
Most advanced-cache.php errors mean the file belongs to a different plugin than the one now trying to use it, or that it points to a plugin that’s gone. Find your message in the table, then the details below.
| Message | What it means | Fix |
|---|---|---|
Fatal error, or Failed opening required naming a plugin file | The drop-in loads a plugin that was deleted | Delete or rename wp-content/advanced-cache.php |
| “WP Super Cache is installed but broken” | WP Super Cache’s drop-in outlived its settings | Delete the drop-in, or reactivate WP Super Cache |
| “WP Rocket cannot configure itself due to missing writing permissions” | WP Rocket can’t write the file | Fix permissions, or delete another plugin’s drop-in |
| “…advanced-cache.php is not a W3 Total Cache drop-in” | Another plugin’s drop-in is in place | Delete it, then save W3TC’s settings |
| “WPO_ADVANCED_CACHE constant is not present in advanced-cache.php” | WP-Optimize found another plugin’s drop-in | Delete it, then turn WP-Optimize’s cache off and on |
| “Constant WP_CACHE already defined” | Two WP_CACHE lines in wp-config | Keep one |
| “WP_CACHE constant set to false” | An old plugin left the switch off | See the WP_CACHE section above |
White screen or “Failed opening required” error mentioning advanced-cache.php
The plugin’s folder is gone but its drop-in isn’t. In PHP 8 the error reads like require(…/wp-content/plugins/old-plugin/…): Failed to open stream: No such file or directory, followed by Failed opening required. Delete or rename the file named in the error (usually wp-content/advanced-cache.php, sometimes object-cache.php or db.php) over SFTP or your host’s file manager.
“WP Super Cache is installed but broken”
This message comes from WP Super Cache’s advanced-cache.php when the WPCACHEHOME line it needs is missing from wp-config. It shows up when the drop-in outlives the plugin. If you’ve removed WP Super Cache, delete wp-content/advanced-cache.php (and wp-content/wp-cache-config.php). If you’re still using it, deactivate, reactivate, then open Settings → WP Super Cache so it writes both lines again.
“WP Rocket cannot configure itself due to missing writing permissions”
The full notice ends with “Affected file/folder: wp-content/advanced-cache.php”. WP Rocket couldn’t write its own drop-in, either because the web server user can’t write to wp-content or because a read-only file from another plugin is in the way. Older WP Rocket versions showed “It seems that the advanced-cache.php file is not ours” in similar cases. Delete any other plugin’s advanced-cache.php, make sure wp-content is writable by the web server user (on aaPanel that’s www), then save WP Rocket’s settings so it writes the file again.
“The Page Cache add-in file advanced-cache.php is not a W3 Total Cache drop-in”
W3 Total Cache found someone else’s drop-in, usually from the plugin you used before. If that plugin is deleted, delete the file and save W3TC’s General Settings; W3TC writes its own version when page cache is on.
“WPO_ADVANCED_CACHE constant is not present in advanced-cache.php”
This is WP-Optimize saying the same thing: the drop-in in wp-content isn’t its own. Delete the file, then switch WP-Optimize’s page cache off and on again so it creates a fresh one.
“Constant WP_CACHE already defined”
A PHP warning, not a fatal error: wp-config.php has two WP_CACHE lines, often one from you and one from a plugin. Delete one and keep a single line above the “stop editing” comment.
Old pages still showing
Something outside WordPress is still serving the old copy. In order: purge your CDN (Cloudflare → Caching → Configuration → Purge Everything), check for an Nginx or Apache rule that still points at the old plugin’s cache folder, then empty wp-content/cache. My post on WordPress changes not showing walks through each cache layer.
Nginx won’t reload or restart
Run sudo nginx -t (it only tests the config, it changes nothing) and read the file it complains about. After W3 Total Cache, it’s almost always an include line pointing at an nginx.conf that’s been deleted. Remove the line, run sudo nginx -t again until it says the test is successful, then reload Nginx (aaPanel: App Store → Nginx → Reload). A reload with a valid config doesn’t drop visitors.
The new plugin says another cache plugin is active
Usually it’s finding the old plugin’s advanced-cache.php (or the old plugin is still active). Delete the drop-in, fix wp-config as above, and save the new plugin’s settings so it writes its own file.
What I didn’t test
This covers the five plugins I installed and removed myself, on Nginx. I didn’t test LiteSpeed Cache (its page cache needs a LiteSpeed server). I also removed Jetpack Boost and WP-Optimize from the test site but didn’t record what they left behind, so they aren’t in the leftovers list. On Apache, the .htaccess rules play the part that nginx.conf plays here. I didn’t run that, so check your plugin’s documentation for its exact block.
FAQ
What is advanced-cache.php in WordPress?
It’s a drop-in file in wp-content that a page cache plugin creates. WordPress loads it very early on each request, but only when WP_CACHE is true in wp-config.php, so the plugin can serve a saved copy of the page before most of WordPress runs.
Is it safe to delete advanced-cache.php?
Yes, if no page cache plugin is active. Nothing breaks, WordPress just skips it. If a cache plugin is active, leave it alone: caching stops working until the plugin writes the file again. If your site shows a fatal error that mentions advanced-cache.php, deleting it is the fix.
Why does advanced-cache.php come back after I delete it?
An active cache plugin is writing it again, usually when it’s activated or when you save its settings. Open the file to see which plugin it names, and deactivate and delete that plugin first if you want the file gone for good.
Should WP_CACHE be true or false?
True only while a page cache plugin that uses advanced-cache.php is active. With no cache plugin, set it to false or remove the line; WordPress treats a missing WP_CACHE as false.
How do I fix “WP_CACHE constant set to false”?
Open wp-config.php, find the line define(‘WP_CACHE’, false); left by a previous plugin (WP Rocket writes one on deactivation when its licence is active), change false to true, and save. Keep only one WP_CACHE line, above the “stop editing” comment.
Can I use two caching plugins at the same time?
Not two page cache plugins. There is only one advanced-cache.php, and WP Rocket and WP Fastest Cache both say to run one caching plugin. A page cache plus a file optimizer such as Autoptimize is fine; I ran WP Super Cache with Autoptimize with no conflicts.
How do I completely uninstall WP Rocket?
Clear its cache, deactivate, delete it from the Plugins screen, then check wp-config.php for define( ‘WP_CACHE’, false ); // Added by WP Rocket and an empty wp-content/advanced-cache.php. On Apache, also remove the WP Rocket block from .htaccess.
Is advanced-cache.php a virus?
No, it’s a normal WordPress drop-in that page cache plugins create. But malware has used the same file name, because WordPress loads it before plugins. Treat it as suspicious if no cache plugin is active and it isn’t an empty file or a leftover from a plugin you used before, if its code doesn’t load files from the active cache plugin, or if it contains encoded code such as base64_decode or eval.
