admin管理员组

文章数量:1426243

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.

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.

Share Improve this question asked Dec 23, 2018 at 16:55 mrtnmgsmrtnmgs 1371 gold badge3 silver badges10 bronze badges 2
  • 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 Commented Dec 23, 2018 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 Commented Dec 23, 2018 at 22:24
Add a comment  | 

2 Answers 2

Reset to default 2

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!

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

You can do this by installing the 'Classic Editor' plugin: https://wordpress/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

本文标签: wp adminCan39t publishedit or delete posts since Gutenberg update