Support » Fixing WordPress » WP 5.0.1 ‘publishing failed’

  • Resolved iaeon


    I cannot get WP 5.0.1 to edit or create posts or pages when Gutenberg is active.

    VPS – Ubuntu 14.04.5 LTS – PHP 7.13 (others tried) – NGINX (Apache tried) – Plesk Onyx Version 17.8.11 Update #34

    I tried adding the following to php.ini and restarting php / Apache / NGINX
    always_populate_raw_post_data = -1

    I have tried disabling ALL plugins and using a standard WordPress theme.

    Nothing works!


    (I have tried a second VPS with the same results.)

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


    This may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.

    If you can install plugins, install “Health Check”: On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you, while you’re still logged in, without affecting normal visitors to your site.

    I have disabled ALL plugins. Swapped to WP Twenty Sixteen theme (tried another default too just in case).

    I did install Health Check, but as I have already disabled everything and am working on a test site it makes no difference.

    This ‘publishing failed’ / ‘update failed’ situation is the same on other sites on my VPS when I have tried them and on a second (similar but older VPS) so very replicable!

    Moderator t-p


    Try MANUALLY updating. Download WordPress again and unzip it, and use that to copy up. Access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), and delete then replace your copies of everything on the server EXCEPT the wp-config.php file and the /wp-content/ directory with fresh copies from the download. This will effectively replace all of your core files without damaging your content and settings. (NOTE: do not delete the wp-content directory or your wp-config.php file). Please read the Manual Update directions first.

    Backup: If you haven’t already done, always backup everything (including your database) before doing any actions, just in case something really goes wrong. You can never have enough backups!

    I have tried manually replacing all of WordPress apart from /wp-content and wp-config.php but not solved the problem.

    /wp-json/wp/v2/posts cannot be found so the REST is not working. Pretty permalinks are set.

    Another freshly installed domain on the same VPS IS working. I cannot see any difference in the configuration underpinning the two installs however.

    PHP 7.0.17 MySQL 5.5.54 WP 5.0.2

    What has to be in place for REST to work?

    • This reply was modified 1 year, 5 months ago by iaeon.
    Moderator t-p


    Make sure you have not disabled Rest API with some plugin or snippet

    ALL plugins disabled. Using a default WordPress theme.

    Something else must be going on, but frustratingly I cannot find it!

    Is there anything written in the migrated database which might stop REST API?

    Moderator t-p


    The current version of the “Health Check” plugin can find out if REST API is available or not:

    The REST API call gave the following unexpected result: (404)
    Not Found
    The requested URL /wp-json/wp/v2/posts was not found on this server.

    May be helpful if you’ve tried a lot of things.

    For me /wp-json/wp/v2/posts worked fine so I ruled out REST api issues.
    Another install on my server setup didn’t have this issue so it wasn’t a php.ini config thing or my version of apache or php. Default theme and no plugins activated didn’t fix either.

    In my case this was related to uploading SVGs via the media uploader. If the above is true for you, here’s how to determine if this is your issue: I recreated the issue by doing the following:

    1. Update to WordPress 5.0.2
    2. Make SVG uploadable via media uploader
    3. Upload an SVG via media uploader
    4. Result: Updated Failed / Publishing Failed

    Having cc_mime_types SVG activated in functions.php and then uploading a (well-formed and valid) SVG exported from Adobe Illustrator

    For now I am commenting out my cc_mime_types function and not allowing SVG until this is sorted.

    • This reply was modified 1 year, 5 months ago by Jim Thornton.

    Got there eventually (Kudos to Andy at Line3!)

    The issue again was that running Plesk Onyx / NGINX WordPress REST API was failing so posts and pages could not be saved or updated.

    The fix is as follows:

    1) Under Plesk make Hosting settings ‘FastCGI / Apache’

    2) In WordPress, change settings / permalink to ‘day and name’

    3) REST should now work (check by loading domain.tld/wp-json/wp/v2/posts or running ‘Health Check & Troubleshooting’ WordPress plugin.

    4) In Plesk swap hosting settings back to ‘FPM served by nginx’

    5) In WordPress, change settings / permalink to ‘Post name’

    REST should still work fine so Gutenberg should not return errors when saving.

    WHY it is necessary to first change permalinks under Apache for REST to work I have no idea!

    Moderator t-p


    Glad you got it sorted 🙂

    Use the classic editor By Gutenberg and the problem is resolved! is simple.
    some templates not work proprely and this is the solution

    I fixed the issue by enabling the cron-jobs and without installing Classic Editor.
    I’m using a security plugin and I didn’t make any changes to it.
    No need to change the permalinks.

    cPanel -> Cron Jobs

    0 */6 * * * cd /home/replacethiswithyourown/public_html; php -q wp-cron.php

    I hope this helps!

    Moderator t-p


    Glad it sorted 🙂

    Monika Rao


    I’ve fixed the issue by classic editor Plugin. Thanks @craveirodesign

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘WP 5.0.1 ‘publishing failed’’ is closed to new replies.