Mariam Elkarimi
Mariam Elkarimi

Reputation: 11

Updating failed. Error message: The response is not a valid JSON response

I get this error when i want to add a featured image to my wordpress post "Updating failed. Error message: The response is not a valid JSON response."

Upvotes: 0

Views: 4594

Answers (6)

Francis
Francis

Reputation: 802

I have the same error message. But despite that, the post actually saves or updates. So personally I'm thinking of just ignoring it, however annoying it may be.

I've tried the suggestions I could find: deactivating all plugins, making .htaccess rightable, but the error message remains.

Upvotes: 0

I got the same error:

Updating failed. Error message: The response is not a valid JSON response

after deactivating WordPress plugin Gutenberg. I tried to reactivate it but the error still exists.

The solution to my error was installing the "Classic Editor" plugin.

Upvotes: 0

Yoones Mehdian
Yoones Mehdian

Reputation: 522

In my case it was due to a web server configuration (Apache2):

AllowOverride None

Changed it to :

AllowOverride All

in

/etc/apache2/apache2.conf

Upvotes: 3

Lyubomir
Lyubomir

Reputation: 311

For me this error was shown in the backend editor because of a line of text in another file which echoed that line of text on each response. Incl. when WordPress internally made its own request expecting a JSON response. Once i removed that line issue disappeared.

Upvotes: 0

Sunil Kumar
Sunil Kumar

Reputation: 1804

If you are trying this on your local or production wordpress install you may likely get this error as your .htaccess file is not writeable for security reasons.

Error you will see in wordpress admin interface under permalink setting after you change from plain to any mode:

If your .htaccess file was writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.

Make sure your .htaccess file is writeable whenever you change your permalink setting from PLAIN mode to anyother mode like POST-NAME

Upvotes: 0

tookwebdev
tookwebdev

Reputation: 61

I had the same "not a valid JSON response" error when trying to publish my content. WordPress seems to do a JSON post when publishing a new post/page so I checked the network tab in my Developer Tools. If you check the "response" tab for this JSON call you might see some more details about this invalid JSON response.

In my case (yours might be different) some deprecated debug message was outputted before the actual JSON data and messed up the response. After fixing the deprecated message publishing worked again.

Upvotes: 1

Related Questions