Solving the WordPress error: not a valid JSON response

S

If you’re reading this post, then you’re likely seeing the red WordPress error box reading, “Updating failed. The response is not a valid JSON response.”

Not a valid JSON response

Wordpress error: Updating failed. The response is not a valid JSON response.

Sadly, this error could be many, many things.

Resave Permalinks

In your troubleshooting, the first and easiest step to try is resaving your permalinks. To do so, simply navigate to Settings > Permalinks. You don’t need to change any settings; just click Save Changes. Many report that this resaving fixes the issue; however, this did not solve my Updating Failed error.

Resave permalinks in WordPress
Resave the permalinks in WordPress

I found this WordPress support thread and reviewed it for help. Again, it didn’t solve my issue, but it might solve yours. Changes to the htaccess file were required.

Check if your hosting has a WAF

What worked for me: The WordPress blog that was erroring was hosted on WPMU DEV’s web hosting which has a Web Application Firewall (WAF). You can learn more about what and how the WPMU DEV WAF works in the Documentation Tools section 5.2 WAF.

During troubleshooting, the WPMU Dev’s technician found a lockout by the firewall. This lockout was preventing my post from saving. The solution was disabling the lockout rule in the firewall. Once disabled, the page was able to be saved.

Check Hosting Logs > WAF Log

In my case, the offending post mentioned the term “wp-config.php” file. The term wp-config.php was caught by one of the WAF rules as “matched data.” As this usage was intentional and not malicious, it was decided safe to exclude the rule be disabling it. The steps followed are shown below.

Problematic term in the post: wp-config.php
Check hosting logs to see what WAF rule is causing the issue.
Check hosting logs to see what WAF rule is causing the issue.
Disable the rule by typing in the Rule and Saving.

Happy WordPressing!

Once the WAF rule was disabled, the post was saved with no issue. Exploring the hosting logs was key to getting past the WordPress error, “Updating failed. The response is not a valid JSON response.”

I hope this helps you too!

About the author

Kelly Barkhurst

Designer to Fullstack is my place to geek out and share tech solutions from my day-to-day as a graphic designer, programmer, and business owner (portfolio). I also write on Arts and Bricks, a parenting blog and decal shop that embraces my family’s love of Art and LEGO bricks!

Add comment

Recent Posts

Archives

Categories