If you are new to WordPress or an experienced user, you may come across the error “Updating failed. The response is not a valid JSON response.” or “Updating failed. The response is not a valid JSON response.” while trying to make changes to a page or a post on your site.
Troubleshoot
From my experience the above error is caused by a PHP Memory limit error. To confirm this is the case, you should look at your php logs on your server if you have access. For myself, I launched my CPanel and then clicked on the File Manager, seen below:
Once you launch the File Manager, go to logs file under (/home/userName/logs), see screenshot below:
Open up this file in your favorite text editor (i.e. Notepad, Wordpad, VIM, Notepad++, etc.) then look for a log entry like the one the in the screenshot below. I will be something like (PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/userName/public_html/wp-admin/includes/post.php on line 130):
If you see this error in the logs then you will need to increase the PHP memory_limit in your PHP.INI file. You can either edit that directly on the server or use CPanel.
How to fix this error
The first step is to increase the PHP memory_limit in the PHP.INI file on your server. You can edit this file directly on the server or you can edit it through your CPanel. To edit it directly on the server, just FTP into your server, download the file and edit the limit with your favorite text editor (Notepad, WordPad, VIM, etc. ) then reupload and overwrite your php.ini file on the server. Below, I will show you how to edit this file via CPanel.
Step 1. Launch CPanel
Launch CPanel and navigate too Software > MultiPHP Ini Editor. Screenshot below:
Now its time to increase the memory_limit on both your Home Directory and your domain PHP.INI files. I would recommend increasing this limit to either 128M or 256M depending on your needs or hosting provider limits. You may need to contact your hosting provider too see what the actual limit you can increase your memory too as there maybe be maximum size and increasing it beyond that value may cause additional errors.
Step 2. Increase memory_limit on PHP.INI files
After you updated your PHP.INI settings you should now be able to make updates again to your WordPress site. Please let me know if you have any comments or questions below, thank you.