• Resolved Dallman Ross

    (@spamless)


    I recently installed WordPress 6.0 from scratch on a Ubuntu 20.04 cloud server.

    I overcame various stumbling blocks. But now the WP install is working well — except for one thing that has had me baffled: I could not create any posts.

    Publishing failed. The response is not a valid JSON response.

    I was about to uninstall the whole shebang and start over, when I found a partial fix: If I put permalink settings for posts back to Plain from Month and name, which I prefer, suddenly the JSON error goes away.

    I did try everything on your linked page for this issue:

    How to Fix The Invalid JSON Error in WordPress (Beginner’s Guide) https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-invalid-json-error-in-wordpress-beginners-guide/

    I went through all the points there. They did not resolve the issue.

    Here is basic info on my server:

    $ uname -a
    Linux blog 5.15.0-1011-oracle #15-Ubuntu SMP Fri Jun 10 12:21:49 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator t-p

    (@t-p)

    If I put permalink settings for posts back to Plain from Month and name, which I prefer, suddenly the JSON error goes away

    If that (i.e. Plain) works, then try reading Using_Permalinks before setting a custom permalink structure again.

    Thread Starter Dallman Ross

    (@spamless)

    If that (i.e. Plain) works, then try reading Using_Permalinks before setting a custom permalink structure again.

    Thanks, @t-p, that does shed light on a few things. ??

    However, I am left scratching my head a bit nonetheless. The article says:

    NOTE:
    Your hosting provider should have set up the web servers with the necessary configurations for the Pretty and Almost Pretty Permalinks to work correctly. If they are not, then you need to contact your hosting provider.

    Well, I’m my hosting provider. So, what’s the secret trick to setting up my configuration for a Pretty Permalink structure I prefer?

    It was rather a trap for the unwary that caused me to spend many frustrating hours trying to figure out why I couldn’t post after the sticky-wicket thing I had done was to select a different option on a quite accessible and inviting configuration screen, after all…

    I’m near to ready to mark the thread as resolved, but I’d still like to know what those “necessary configurations” might be.

    Moderator t-p

    (@t-p)

    Thread Starter Dallman Ross

    (@spamless)

    Thanks very much, @t-p!

    Moderator t-p

    (@t-p)

    You are welcome ??

    Thread Starter Dallman Ross

    (@spamless)

    I’m coming back to this to post that finally I found a solution beyond the workaround the moderator showed me.

    Try as I might, I still could not change Permalinks to anything non-default without the JSON publishing error returning. I meanwhile have read about a dozen interesting pages on this, one very good one of which was this one:

    https://passionwp.com/response-is-not-a-valid-json-response-error/

    But not even that solved the issue. Now, however, I found this gem:

    https://codehunter.cc/a/wordpress/wordpress-jsonapi-wp-json-was-not-found-on-this-server

    And that’s what has finally worked! Relevant text:

    [E]nsuring that my apache2.conf file (located in the folder /etc/apache2) has its<Directory> directive ‘AllowOverride’ set to all rather than none

    Yay!

    Moderator t-p

    (@t-p)

    Thanks for posting this info ??

    Thread Starter Dallman Ross

    (@spamless)

    You’re welcome. I wish to add one more article to the collection of ones one might recommend on this issue:

    https://blog.hubspot.com/website/json-response-error-wordpress

    The reason I think this one deserves a look as well is that it includes a diagnostic tip that was important for me to understand the deep details of what was going wrong:

    Check the [browser] console and debug log.

    For more advanced users, you can try digging into your browser’s console or various debug logs to find a more specific problem. This isn’t really a solution for casual users, though, as you’ll need some technical knowledge to accomplish anything here.

    There is a screenshot of the Chrome browser error console there, as well. For me, seeing the error messages on the browser console in real time helped me put two and two together and led to my finding the article I cited above on adjusting the apache2.conf AllowOverride directive to ‘all‘, which is what ultimately worked.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘JSON blocks posts with optional permalinks’ is closed to new replies.