WordPress is usually good except sometimes when you encounter an error due to something else.

While working on Nexus, I encountered an issue while modifying Genesis theme files using the WordPress Editor.

Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.

This is how it looked seem.

As usual, I went through the following troubleshooting steps.

Check Theme Permission

One of the first things you got to check the theme files and folder permissions.

If you are running on shared hosting then mostly it would be alright. However, if using VPS or Cloud then you got to ensure the same user owns theme files as web server (Nginx or Apache HTTP) running.

I am using Nginx on Google Cloud, and it was running with www-data user. Permission looked ok, but I changed it again to ensure if there was any file had wrong.

chown -R www-data:www-data gf

Note: you got to find the user and change www-data with yours. You can use ps command to see it.

ps -ef |grep nginx #if using Nginx
ps -ef |grep http #if using Apache HTTP

Once changed, try to update the files to see it works.

It didn’t work for me.

Check Security Plugins

Are you using any security plugins? Do you have the option to check their logs to see how exactly your request is being treated?

Alternatively, you can quickly disable the security plugin and verify if that works.

Did it help? It didn’t to me.

Check Cloud-based Security (WAF)

Are you using cloud-based security provider WAF? Check the firewall logs to see if its getting challenged or blocked by them?

Guess what, I am using Cloudflare and that was causing an issue.

After spending some good time, I found that Cloudflare WAF was challenging “Update files” requests.

It was getting challenged by multiple security rules (SQL injection, XSS, etc).

I whitelisted my IP in the WAF event details and then it was all ok.

If you are using Cloudflare, you can check the firewall logs by logging into the dashboard. However, if you are using something else then worth checking their logs or contact the support to confirm if its due to WAF.

I was able to fix my issue and hope this helps you.