Page caching and object caching depend on a few files outside the plugin folder: the WP_CACHE line in wp-config.php and the advanced-cache.php and object-cache.php drop-ins in wp-content. Other plugins, migrations or restores can change or remove them. Fix configuration writes them again from your saved settings, without changing any setting.
Available in: Powered Cache (free)
Where to find it: Powered Cache → Tools → Regenerate Configuration, the Settings check at the top of the settings screen, and admin notices about broken caching.
When to use it #
- After you removed or deactivated another cache plugin. Cache plugins often remove
WP_CACHEor deleteadvanced-cache.phpwhen they are deactivated, even if Powered Cache uses them. - After you moved the site to another server or restored a backup without the
wp-contentdrop-ins. - When a notice says Page Cache is not working, because: or The object cache file seems missing.
- When the Settings check offers the button.
Do not run it while another page caching plugin is still active. Fix configuration overwrites advanced-cache.php, even when another plugin created it.
What it rewrites #
| File | What happens |
|---|---|
wp-config.php | Adds define( 'WP_CACHE', true ); // Powered Cache right after the opening <?php line, and removes any other WP_CACHE line. If page caching is off, it writes false instead. Nothing changes when the value is already correct. Powered Cache looks for wp-config.php in the WordPress folder and up to two folders above it. |
wp-content/advanced-cache.php | Written again so it loads the Powered Cache page cache. If page caching is off on a single site, the file is emptied. |
wp-content/object-cache.php | Written again for your selected object cache backend. If object caching is off, the file is deleted only when Powered Cache created it. While Development Mode is on, no object cache drop-in is written. |
.htaccess | On Apache, the Powered Cache rules are written again when .htaccess Configuration is on. See Server Configuration. |
wp-content/pc-config/ | The configuration file the page cache reads before WordPress loads is written again. |
Your settings and cached pages are not changed.
Run Fix configuration #
- Deactivate any other page caching plugin.
- Go to Powered Cache → Tools.
- In the Regenerate Configuration card, click Fix configuration. You can also click the same button in an admin notice or in the Settings check.
- Read the result notice:
- Configuration files have been regenerated.: everything is in place.
- Some configuration files could not be updated.: see File permission problems.
- Check that pages are cached again.
After the files are written, Powered Cache reads them back. It reports a problem when WP_CACHE is not set to true while page caching is on, when advanced-cache.php does not load Powered Cache, or when object caching is on and object-cache.php does not load Powered Cache.
The Settings check #
When some settings cannot work as saved, a Settings check box appears at the top of the Powered Cache settings screen. It shows how many settings need attention, lists up to four of them, and says how many more checks are shown next to their settings. Click a setting name to jump to its section.
The box includes a Fix configuration button when one of these issues is listed:
- Page Cache: Page cache needs WP_CACHE enabled in wp-config.php before cached pages can be served.
- Page Cache: The advanced-cache.php drop-in is not loading Powered Cache page caching.
- Object Cache: Object cache is enabled, but wp-content/object-cache.php is missing or not accessible.
Other issues, such as a missing Varnish address or a page cache drop-in that the server cannot load at all, need a change in your settings or on the server instead. The Optimization Advisor shows the same health checks as cards.
New in 4.0: the Fix configuration action in admin notices, the Settings check and Tools. Before 4.0, the configuration files were only rewritten as a side effect of saving the settings.
File permission problems #
If you see Some configuration files could not be updated. Make sure wp-config.php and the wp-content directory are writable, PHP is not allowed to write one of the files. Choose one of these fixes:
- Ask your host to let the web server user write to
wp-config.phpand thewp-contentfolder, then run Fix configuration again. Some hosts lockwp-config.phpon purpose. - Or add the line below to
wp-config.phpyourself, above the line That’s all, stop editing!, then run Fix configuration again so the drop-ins are written.
define( 'WP_CACHE', true );
If a notice says Powered Cache could not access dropin, the page cache file inside the plugin folder is missing or unreadable. Fix configuration cannot repair that. Reinstall Powered Cache.
Multisite #
On a multisite network, advanced-cache.php is always kept in place, and only a network administrator of a network-activated installation can write object-cache.php and .htaccess. See Multisite Setup.
For developers #
The powered_cache_configuration_regenerated action runs after Fix configuration. See the Hooks Reference.