How to Fix “Updating Failed. The Response is Not a Valid JSON Response”
Follow this guide to Fix “Updating Failed. The Response is Not a Valid JSON Response”
The “Updating Failed. The Response is Not a Valid JSON Response” error is a common issue in WordPress that can occur when trying to save or update a post or page. This error usually indicates that there is a problem with the communication between the browser and the server, often related to the REST API. Here is a comprehensive guide to troubleshooting and resolving this error.
1. Clear Browser Cache and Cookies
Start by clearing your browser’s cache and cookies. This can often resolve the issue if it’s caused by outdated or corrupted data in your browser.
Steps to Clear Cache and Cookies
- Google Chrome:
- Click on the three dots in the top right corner.
- Go to More tools > Clear browsing data.
- Select Cached images and files and Cookies and other site data.
- Click Clear data.
- Firefox:
- Click on the three lines in the top right corner.
- Go to Options > Privacy & Security.
- Scroll down to Cookies and Site Data and click Clear Data.
- Safari:
- Click on Safari in the top menu.
- Go to Preferences > Privacy.
- Click Manage Website Data and then Remove All.
2. Check WordPress and Plugin Updates
Ensure that your WordPress core, themes, and plugins are up-to-date. Outdated software can cause compatibility issues that lead to errors.
Steps to Update WordPress
- Update WordPress Core:
- Go to Dashboard > Updates.
- If a new version of WordPress is available, click Update Now.
- Update Themes and Plugins:
- Go to Dashboard > Updates.
- Select all themes and plugins that have updates available and click Update Plugins or Update Themes.
3. Permalinks and .htaccess
Sometimes, issues with permalinks or the .htaccess file can cause this error. Resetting permalinks can help.
Steps to Reset Permalinks
- Go to Settings > Permalinks.
- Without changing any settings, click Save Changes.
Steps to Reset .htaccess File
- Access your site via FTP or the file manager in your hosting control panel.
- Rename the .htaccess file to something like .htaccess_old.
- Go back to Settings > Permalinks in your WordPress dashboard and click Save Changes. This will generate a new .htaccess file.
4. Disable Plugins and Themes
A conflicting plugin or theme can also cause this issue. Temporarily disable all plugins and switch to a default theme to see if the error persists.
Steps to Disable Plugins
- Go to Plugins > Installed Plugins.
- Select all plugins, choose Deactivate from the bulk actions dropdown, and click Apply.
Steps to Switch to Default Theme
- Go to Appearance > Themes.
- Activate a default theme like Twenty Twenty-One.
If the error is resolved, reactivate your plugins one by one and switch back to your original theme to identify the culprit.
5. Check REST API Status
The “Updating Failed” error is often related to the REST API. Check the status of your site’s REST API.
Steps to Check REST API Status
- Go to Tools > Site Health.
- Click on the Status tab and look for any REST API-related issues.
6. Adjust WordPress URL Settings
Ensure that your WordPress Address (URL) and Site Address (URL) are correct and use the same protocol (HTTP or HTTPS).
Steps to Adjust URL Settings
- Go to Settings > General.
- Verify that both WordPress Address (URL) and Site Address (URL) are correct.
- Make sure both URLs use the same protocol (either HTTP or HTTPS).
7. Server Configuration
Ensure your server is configured correctly to handle REST API requests. Check server logs for any errors and contact your hosting provider if necessary.
Steps to Check Server Configuration
- Access server logs via your hosting control panel or FTP.
- Look for any errors related to REST API or JSON responses.
- Contact your hosting provider for assistance if needed.
8. Disable Security Plugins and Firewalls
Security plugins and firewalls can sometimes block REST API requests. Temporarily disable any security plugins or firewall rules to see if the issue is resolved.
Steps to Disable Security Plugins
- Go to Plugins > Installed Plugins.
- Deactivate any security plugins.
9. Increase PHP Memory Limit
A low PHP memory limit can cause this issue. Increasing the memory limit can help.
Steps to Increase PHP Memory Limit
- Access your wp-config.php file via FTP or file manager.
- Add the following line before the /* That’s all, stop editing! Happy blogging. */ line:
php
define(‘WP_MEMORY_LIMIT’, ‘256M’);
10. Check for JavaScript Errors
JavaScript errors in your browser’s console can also cause this issue. Check for and resolve any JavaScript errors.
Steps to Check JavaScript Errors
- Open your browser’s developer tools (F12 or right-click and select Inspect).
- Go to the Console tab and look for any errors.
11. Use Classic Editor as a Workaround
If the error persists, you can use the Classic Editor as a workaround to make and save your changes.
Steps to Use Classic Editor
- Download and Install Classic Editor Plugin:
- Go to Plugins > Add New.
- Search for Classic Editor.
- Click Install Now and then Activate.
- Configure Network Settings (For Multisite):
- Go to Network Admin > Settings.
- Allow and select the block editor as the default and check the box allowing site admins to change settings.
- Configure Writing Settings (For Site with JSON Issue):
- Go to the site with the JSON issue.
- Go to Settings > Writing.
- Select the option to allow users to switch editors.
- Edit Page with JSON Error:
- Go to the page with the JSON error and edit it in block mode.
- Make the changes that result in the JSON error.
- Your edits cannot be committed to the database because of this error.
- Copy and Paste Code:
- View the code for that page, select all the code, and copy it.
- Exit out of the page edit screen.
- Update Page in Classic Editor:
- Go back to that page under the Classic Editor.
- Click on Text view (code view).
- Replace the code with what you just copied.
- Update the page and your block edits will be committed to the database with no problem.
Conclusion
By following these steps, you should be able to resolve the “Updating Failed. The Response is Not a Valid JSON Response” error in WordPress. If the issue persists, consider seeking help from the WordPress support forums or your hosting provider.