2

I am able to create a new post but I get a generic error message Publishing failed if I try to publish it. Same thing if I try to edit it (or any other post). If I try to delete the post using the Move to trash button, I get another error: The response is not a valid JSON response.

The issue only happens in the new Gutenberg interface (wp-admin/post.php) I am able to publish or remove the post using the "quick edit" functions on the posts list view (wp-admin/edit.php) The problem occurs with all users and for all post types (I tried with posts and pages). Deactivating all plugins and visiting the permalinks page did not solve the issue.

  • What's the PHP version, web server, and platform? Also, are any other errors appearing in the PHP error log?I encountered the issue with Publishing Failed on Gutenberg posts on an older XAMPP install (PHP 5.6) on Windows. I was able to resolve it by adding always_populate_raw_post_data to -1 in php.ini and then restarting Apache. Side note, I updated XAMPP to the latest version running PHP 7.3 and did not encounter this issue. – Dave Romsey Dec 23 '18 at 17:52
  • 1
    The server is Red Hat 4.8.5-16, runs PHP 7.0.32 and Apache 2.4.37. Upgrading to PHP 7.2 didn't solve the issue, and with 7.3 I get a blank screen... – mrtnmgs Dec 23 '18 at 22:24
2

Disable Gutenberg and return to using the classic editor (aka: TinyMCE).

You can do this by installing the 'Classic Editor' plugin: https://wordpress.org/plugins/classic-editor/

When disabling Gutenberg, you have two different modes to choose from:

  1. Always use the classic editor (completely removes Gutenberg)

  2. Switch between Gutenberg & the classic editor (using different links)

Always Use Classic Editor:

This is the default option. As soon as you activate the plugin, Gutenberg will be completely disabled. All of your post & page edit screens will look like they did in WordPress 4.9 and below. That's it! Happy editing 🙂

Switch Between Gutenberg & Classic Editor:

If you want to be able to use both editing methods, perhaps during a transitional time where you're still learning Gutenberg, this is a great option.

  • Head over to Settings > Writing, and look for "Classic editor settings."

  • Check the box that says "Do not replace the editor."

  • Save Changes

Here is a full article expanding on reverting back from Gutenberg to classic, and how to switch between the two: https://gogutenberg.com/disable-gutenberg/

1

This is most likely a plugin or theme conflict in one way or another. Here's the steps I've taken when troubleshooting Gutenberg-related issues:

  1. In a staging environment, deactivate all plugins -- posting should work as intended now. If it doesn't then the issue is more likely a theme conflict.

    1.a. If it's a theme conflict, then switch to a default theme to confirm. If you confirm it's a theme conflict, start by going through your functions.php file and commenting out all add_action and add_filter lines one by one until you find the culprit.

    1.b. If none of the actions or filters are the issue, then start commenting out each wp_enqueue_scripts line one by one. Most likely the conflict then is with some JS that your theme enqueues throughout the admin area.

  2. If you determined that it was a plugin conflict, activate each plugin one by one until you see the problem again. I would start with plugins that interact with your post edit screen in any way, like metabox plugins or custom post type plugins, etc. Also plugins that interacted with TinyMCE in any way. Once you find the offending plugin or combination of plugins, you can decide whether you really need that plugin or not, bring it up to the plugin author, or start troubleshooting the issue yourself (in a similar fashion to how I described theme troubleshooting above.

That method finds the solution typically 9.5/10 times for me. If none of that works, then you need to look at your hosting environment for strange htaccess issues, or wp-config configurations, or server-side security or caching issues.

Good luck!

  • Yes these are pretty much the steps I followed, but the problem persists even on a basic twenty* WP theme with no plugins. So probably a server configuration issue indeed, but I haven't been able to figure it out yet... It is strange that it only affects the new Gutenberg editor, and quite frustrating that this new editor introduces the possibility of this new problem and deals with it with very vague error messages... – mrtnmgs Dec 23 '18 at 22:26
  • I'd install the Health Check plugin to inspect your server environment and see if any notifications come up at all. If it is in fact a server issue it is most likely related to admin-ajax or file permissions or something common. – Matt Cromwell Dec 29 '18 at 5:58

protected by Community May 26 at 18:53

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.