• Hello everybody,

    on an new WordPress 6.7.1 installation (default theme, no installed plugins), when I try to create and publish a new page or post, I get the following message: “Publishing failed. The response is not a valid JSON response.“. That happens if Permalink structure is set to “Post name“. If I set it to “Plain” everything is working just fine.

    I have already changed line 172 of apache file (/etc/apache2/apache2.conf) from AllowOverride none to AllowOverride all, as a lot of users suggest it in order to resolve the specific error, but it didn’t make any difference.

    Gould you please help?
    Regards, Manolis

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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.
    Thread Starter manspan

    (@manspan)

    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

    1. 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

    Thread Starter manspan

    (@manspan)

    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.

    Thread Starter manspan

    (@manspan)

    Yes, I restarted Apache. I will check the error logs for any useful information.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.