The error “Publishing failed. The response is not a valid JSON response” often occurs due to issues with permalink settings, server configurations, or WordPress rewrite rules. Since you’ve already set AllowOverride All
in the Apache configuration, it’s possible the required .htaccess
file is missing or incorrectly configured
Ensure .htaccess
Exists
- Navigate to your WordPress installation directory.
- Check if a
.htaccess
file exists. If it doesn’t:
- Create a new
.htaccess
file in the root directory.
the file exists:
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /wordpress/ RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
Hello @manspan
- Check if .htaccess exists in your WordPress root directory.
If it doesn’t exist, create it and add the following content:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Save the file
2. Enable WordPress debugging to check for errors
add below code to wp-config.php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Check the debug log in /wp-content/debug.log.
3. Re-save Permalinks : go to Settings > Permalinks. Click Save Changes
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
# END WordPress
Add this in your .htaccess file
I don’t see any difference. The third line I posted is actually the third and the fourth together (my mistake on pasting the text from the file).
Did you also restart the Apache service after changing the Apache configuration?
Also check the error log of the hosting to see if and which errors are mentioned there.
Yes, I restarted Apache. I will check the error logs for any useful information.