Question

How to fix Scrape key check failed error saving php files in a WordPress droplet

When creating a WordPress droplet from the marketplace (https://marketplace.digitalocean.com/apps/wordpress). It’s not possible to save a PHP file from the “Theme Editor” in WordPress as it returns “Scrape key check failed. Please try again.” when clicking the Save button. I didn’t install or did anything to the droplet. I created a droplet, logged into WordPress, I went to the Theme Editor tried to save one of the PHP files of the theme and then I get the error. This happens with all themes and it’s not a problem with a plugin because the site doesn’t have anything. I know it’s not recommended to edit files from the Theme Editor, but the point is that it is supposed to work. Also, saving changes to the sytle.css, for example, works.

How to fix this problem? Or please fix the droplet.


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

My problem is got solved when i delete file object-cache.php inside /wp-content folder. The problem arise when i installed wp-redis on digitalocean Ubuntu 22.04 droplet. (I am using NGINX, PHP8.1-FPM, Mariadb 10.10.2.

I don’t know why the problem arise, because i migrated my /html whole directory and database on new server to create staging environment. First everything is fine but when i enable wp-redis plugin in WordPress and enable object cache the error arise “Scrape key check failed”.

Note: The file object-cache is already present in my /wp-content folder as i say i migrated, means in previous server i already have enabled redis and there was no issue.

To fix the problem i tried.

  1. Change file and folder permission to 644 and 755 (Not work).
  2. Change Usergroup to www-data and user (Not work).
  3. Change WordPress salt in wp-config.php (Not work)
  4. Update PHP version and clear cache on server as well as cloudflare *Not work).
  5. Search everywhere on the internet for 4 days and nothing helps.
  6. Finally create another site as test1 and install a fresh wordpress and fresh database (works fine). So i know the problem is not with my server. Then i start messing with files. And after i delete object-cache.php and restart server (with cache cleared on server) (works fine.

**

SO TO FIX PROBLEM JUST DELETE ANY CACHE FILE LIKE OBJECT-CACHE.PHP OR ADVANCED-CACHE.PHP

**

After migration regenerate them (Do not use previous file, if using wp-rocket it will regenerate automatically, if using NGINX and redis, reinstall wp-redis on server and enable wp-redis plugin it will regenerate the file) and problem will not occur any further.

KFSys
Site Moderator
Site Moderator badge
April 14, 2022

Hi @mhweb,

That’s really weird! This issue shouldn’t be happening to a brand new WordPress website.

Usually, this issue is related to a Plugin(the most common is SG Optimizer plugin) or some Cache (the most common is objected cache) other people report it’s from Wordfence Security. I know you said there are no plugins I’m just stating the usual issues with the reported error.

As a last resort since it’s a new droplet, you can try to re-install WordPress to see if you’ll still experience the issue.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.