This error happens because WP-Optimize needs to write to the advanced-cache.php file to enable caching, but it doesn’t have the necessary permissions.
To fix the issue, use an FTP client or your hosting File Manager to access your site files. Navigate to /wp-content, create a file named advanced-cache.php (if it doesn’t exist), and set permissions to 644. Open the file and paste this:
<?php
// WP-Optimize Cache
if ( ! defined('ABSPATH') ) {
exit; // Exit if accessed directly
}
Save the file, ensure caching is enabled in WP-Optimize, and you’re all set! If errors persist, check permissions or contact your host for assistance.
I am a novice with FTP client or Hosting File Manager including how to navigate to /wp-content or to create a file named advanced-cache.php and set permissions to 644.
I would need step-by-step instructions in order to do so.
As an alternative, would it work if I used the Code Snippet Plugin to enter this code:
<?php
// WP-Optimize Cache
if ( ! defined('ABSPATH') ) {
exit; // Exit if accessed directly
}
Thank you
Unfortunately, using the Code Snippet Plugin won’t work because the advanced-cache.php file needs to be physically present in your site’s filesystem for caching to function correctly. Here’s a step-by-step guide to resolve the issue and create the advanced-cache.php file. Don’t worry—it’s straightforward even if you’re new to this!
Use Your Hosting File Manager:
- Log in to your hosting account and open the File Manager.
- Navigate to the
wp-content folder.
- Check if
advanced-cache.php exists. If not, create a new file with that name.
- Open the file and paste this code:
<?php
// WP-Optimize Cache
if ( ! defined('ABSPATH') ) {
exit; // Exit if accessed directly
}
- Save the file and set permissions to 644.
- Finally, Enable Caching in WP-Optimize: Go to your WordPress Dashboard > WP-Optimize > Cache and make sure caching is turned on.
If you run into any issues, feel free to ask for further assistance