WordPress Error “Publishing failed. The response is not a valid JSON response.”

If you try to create a new page in WordPress and get the following error. “Publishing failed. The response is not a valid JSON response.”

You may be tempted to go down a path that’s code-related given the details in the error message. However, please check your web-server config first because this is likely an access control issue.

Please add this to your server’s config (Make sure you edit the path to match your docroot):

<Directory> /var/www/html/yoursitename/public_html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

Notes on what this is actually doing:

FollowSymLinks means if a dir is a symbolic link, follow the link.
Indexes mean a dir can be shown as a list if there is no index page.
AllowOverride directive is used to allow the use of .htaccess within the webserver to allow overriding of the Apache config on a per-directory basis.
Require all granted: No IP addresses blocked from accessing this service.

In my case, AllowOverride is what’s fixing the issue here. Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *