What is an "invalid JSON" error?
You're working on your WordPress site and everything looks great! You click the Publish button and uh-oh, you receive an "invalid JSON" error. ๐
There are many reasons you could be seeing this error. Itโs a pretty general message that - for some reason - your post isnโt making it to the server. The first step to start debugging this issue is to copy and paste the error message into Google or your chatbot of choice (ChatGPT, Claude, etc.) When you do, youโll see several articles with great suggestions you can work your way through. Here are a few that we found:
https://themeisle.com/blog/how-to-fix-updating-failed-the-response-is-not-a-valid-json-response/
https://themeisle.com/blog/how-to-fix-updating-failed-the-response-is-not-a-valid-json-response/
Try out each of the suggestions to find the cause for your install. We would suggest starting with changing your permalinks to Plain. If you still aren't able to publish the post, try all the different variations of permalinks. Some students found that some worked for them, while others didnโt. When you change the permalink, try hitting the button to save your choice twice. You can refer to this lesson in the WordPress class for more details on changing your permalinks.
Next, check the httpd.conf file in your MAMP or XAMPP application
MAMP users will navigate to the httpd.conf file via this path:
/Applications/MAMP/conf/apache/httpd.conf
You can do this in Finder or in VS Code. If you navigate to the httpd.conf file via Finder, double-click on the file to "Open With" VS Code.
XAMPP users will navigate to the httpd.conf file via this path:
This-PC/Local Disk (C:)/xampp/apache/conf/httpd.conf
You can do this in File Explorer or in VS Code. If you navigate to the httpd.conf file via File Explorer, right click on the file to "Open With" VS Code.
Find the line
LoadModule rewrite_module modules/mod_rewrite.so
(it may be on line 133.) Make sure that the line isn't commented out.- Save the file
- Restart MAMP or XAMPP
In addition to the suggestions in the articles, if you have any emojis in your post, try removing them and see if you're able to save your work. ๐ข
I hope that helps! It can be tedious to try to debug an error message like this one because it is specific to your workspace. But it will help you to build your skills and learn more about how to debug a WordPress site. ๐ช
Oh, and if you don't mind taking the time, let us know what solution worked for you. Your feedback can help a future Skillcrusher facing the same error message. ๐