You edit a page, you try to publish or even just add an image and you encounter the following error:
Publishing failed. Error message: The response is not a valid JSON response.
There are two main causes for this problem
- Problem with permalinks: a permalink, to keep it simple, represents the URLs of the pages of your site. In WordPress, you can use permalinks to manage the link format of your pages. Example: www.exemple.com/?p=953 can be changed to www.exemple.com/my-post, which is still more readable.
- Your site has “mixed-content”: these are resources that are loaded in http and others in https in your site, causing alerts or sometimes some errors.
If your problem is related to permalinks, there is a simple tip to solve your problem:
- Go to your WordPress administration
- Go to “Settings” and then “Permalinks”.
- And… simply save the settings directly. This will re-save good settings (WordPress will generate the URL rewriting rules and will try to include them in the .htaccess file at the root of your site; if writing the htaccess file is impossible, check the read/write permissions linked to this file).
If your concern is related to mixed content, it should be able to identify if you have resources loaded in http and others in https. You can observe this in a console when you are on each page of your website (to open the developer console when you visit a page: F12 under Firefox / Chrome, CTRL + SHIFT + C under Opera; then go to the “Console” tab). Example of an alert result :
You will then have to locate each problem and correct them in the right places. If necessary, you may need to re-upload elements to https.
You can also check if your WordPress is properly configured :
- Login to your WordPress administration
- Go to “Settings” then “General”.
- Look at the WordPress address / your site address, if it starts with http or https. If necessary, correct it and save the changes.