If you are trying to fix the invalid JSON error in WordPress.
This error occurs whenever when we do editing post or page in wordpress website. Then your page or post failed to save and display an error: “The response is not a valid JSON response’ and updating that page would fail”.
But for some reason, you will be seeing error like: WordPress fails to get the response, or the response is not in JSON format, then you will be seeing the ‘Not a valid JSON response error’.
You can find many reasons for this issue. Also, you can find many solutions like:
- Checking WordPress Urls in the Settings->permalinks
- Fixing WordPress Permalink Structure
- Changing in the htaccess file
- Fixing the WordPress plugins conflict
- Installing the ‘Classic Editor’ and editing a post using it
But these checks might not bring you to permanent solution. If so please make changes as given below:
6. By making changes in Modsecurity
Step 1: Login to your Hosting Control Panel.
Step 2: Select Modsecurity option from the Control Panel Dashboard.
Step 3: You will find there ‘log’ option tab. Please click on that.
Step 4: Please check the error log for getting failed to save post.
Step 5: Once you have selected the specific error log, please apply the option “Skip Rule”.
Step 6: Now all set! Please edit your post now. You will get no error now.
Please let us know if this is useful to you.