Support » Fixing WordPress » Publishing fail after update to wordpress 5.0

  • Hello,
    After update to wordpress 5.0, I can’t publish any post at all. It keeps showing up Publishing failed error. Also, after save the draft. After that, I cant save it as draft/publish or anything. It only shows Draft failed, Publishing Failed. I only able to change it through quick edit.

    Further more, I can’t make any setting changes at all. Whenever I click save in the Setting menu (Permalink, etc) it gives me error HTTP 500

    • This topic was modified 7 months, 1 week ago by  ninhigan.
Viewing 15 replies - 1 through 15 (of 23 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    If you have any type of “security” plugin, make sure that you have not set it to disable the “REST API”. If the plugin has a setting for that, turn off the setting. If that doesn’t work, turn off the security plugin.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Yes, if you’re blocking wp-json and thus blocking the REST API, then the new editor will not work.

    The new editor is a javascript application. It runs in your browser, and communicates to your site using the wp-json REST API. You need to have that enabled. If you have added any security plugins, or anything similar to block that, then you will need to undo that in order for the editor to work properly.

    I don’t know why this should happen at all!

    Publishing is the key in a blog program. We shall not need to know more than set the WordPress up to get it working!

    Also, the new editor is missing more features: tags, categories.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Also, the new editor is missing more features: tags, categories.

    See, it’s not, actually. Things like tags and categories being missing are telling us that you have a problem on your server, where something is blocking the REST API.

    WordPress has a thing called the REST API in it. It’s basically calls to the site that have the word “wp-json” in them. It is how the new editor talks to the site, in the background. The REST API has been around for a couple years, but this is one of the first major uses of it.

    Now, to display the categories, for example, the editor sends a request to the site that basically says “hey, give me a list of the categories”. If you are blocking that somehow, you don’t get the category listing.

    How are you blocking it? Well, over the past two years, a lot of “security” plugins and other misguided tutorials have recommended to either block or disable the REST API. They were wrong, and you need to not do that.

    If you have any security plugins, turn them off. If you have any rules in the .htaccess file that block the wp-json requests, remove them. The editor in your browser needs to be able to talk to the site, to display things like tags and categories, as well as to be able to send the post content to the server for publishing. So you have to not block the REST API for it to do that.

    Installed the classic editor, everything works again….

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Another possibility which has not been mentioned: Go to the Settings->Permalink page and re-save your permalinks.

    In a couple of cases we’ve seen on the forums, the default .htaccess rules made by some installers such as Softaculous are slightly incorrect, and resaving the permalink settings should rewrite the .htaccess file correctly.

    It’s a bit of a long shot, but it doesn’t hurt to try.

    Thanks for the assistance.

    -Tried the permalinks solution and did not work.

    -Disabled all my plugins (All In One SEO Pack, Classic Editor, Contact Form 7, WordPress importer).

    -WP still does not save/update a page.

    -The Classic Editor does not work for me. (Cannot click on the tabs in the classic editor. The classic visual editor shows no content, even though the content is available on the actual page).

    -I have not put anything into my .htaccess file to block wp-json requests (it’s just the basic WP htaccess plus a few 307 redirects).

    -I have no security plugins.

    -I use Cloudflare.

    So there must be something blocking it. Not sure if this is a Cloudflare issue, but I can’t see why that should cause a problem – it is used by so many.

    I had similar issue, it got solved by disabling Gutenberg editor and installing and activating Classic Editor

    “If you have any security plugins, turn them off. If you have any rules in the .htaccess file that block the wp-json requests, remove them. ”

    I have no security plugins. I don’t know if any of my .htaccess is blocking. How would I know? Nothing mentions json and the only line mentioning security is this:
    Header add Strict-Transport-Security “max-age=300”

    Is that line presenting a problem?
    J

    The following situation of wizs (@wizs) is nearly EXACTLY my situation. I have tried all of this, and I don’t even have any 307’s.

    Thanks for the assistance.

    -Tried the permalinks solution and did not work.

    -Disabled all my plugins (All In One SEO Pack, Classic Editor, Contact Form 7, WordPress importer).

    -WP still does not save/update a page.

    -The Classic Editor does not work for me. (Cannot click on the tabs in the classic editor. The classic visual editor shows no content, even though the content is available on the actual page).

    -I have not put anything into my .htaccess file to block wp-json requests (it’s just the basic WP htaccess plus a few 307 redirects).

    -I have no security plugins.

    -I use Cloudflare.

    So there must be something blocking it. Not sure if this is a Cloudflare issue, but I can’t see why that should cause a problem – it is used by so many.

    Brijesh Mishra (@brijeshmkt)

    I don’t know what restarting a server means. Do I need to tell DreamHost to turn off their servers to make my site work with this work? I doubt they will as I am on a shared server.

    J

    On local server when we make changes in php.ini file server restart is required. But on shared hosting like hosting on DreamHost making changes in php.ini file should work. Generally shared hosting provides php.ini file, you can add always_populate_raw_post_data = -1 in a new line and that should work.

    Let me know if this helps.
    Note: On VPS server you can simply restart apache server.
    Note: Restart server means restarted httpd services (Avoiding confusion over here)

    Thanks! I’ll try this.

    J

    @brijeshmkt
    I am using the Enfold Child theme. I cannot find a php.ini file in the editor. I do have WPide that shows most of my server folders/files (I can also access via FileZilla), but I don’t quite know where to start to find the php.ini. Can you point me in the right direction?

    Thanks for your help!
    Jon

    php.ini file is in the root directory. The root directory is the place where your WordPress is installed. Or you might be able to edit php.ini file from your cpanel

    Let me know if this works so that others can benefit from our discussion.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Publishing fail after update to wordpress 5.0’ is closed to new replies.