WordPress interview questions you need the answers to
January 31, 2020WordPress missing a temporary folder: Easy fixing guide
February 7, 2020WordPress is a completely open source tool, free for users. However, occasionally some odd error messages will appear which can interfere with your work.
For example, you can be prevented from creating new posts or editing posts and a WordPress ‘Publishing failed’ notification or ‘Updating failed’ error message will appear, which can be frustrating when you’re in the flow of work.
This article is designed to help you understand the cause of the error and provide a few ways to fix it as quickly as possible.
How to get rid of the WordPress ‘Publishing Failed’ error in version 5.2.3
Try these actions to solve the WordPress ‘Publishing failed’ problem on your site.
- Clear browser history
- Change the permalinks
- Enable CDN
- Change your site’s fastcgi cache folder
- Change on Cloudflare to Full SSL from Flexible SSL
- Use the WordPress plugin - Classic Editor
- Activate debug mode
- Reactivate your plugins
- Turn off HTTPS for all pages of your WordPress blog while you are editing
Badly Designed Cache Plugin
The cause of the issue may be a bad cache plugin. Popular plugins include WP super cache, W3 Total Cache and Autoptimize. These tools clear the cache on your site when changes are made. If the plugin is incorrectly designed, the cache may not be cleared, and your old site will appear.
Try to empty the cache with the plugin settings. If the plugin you have is W3 Total Cache, go to settings and empty cache. This should solve your problem and make the changes visible to users.
The plugin can also define what needs to be cached. This page cache functionality is available in W3 Total Cache. Under Page Cache, go to the menu where you’ll see a way of not caching the front page. Usually, it will be set to caching the front page and you can untick this.
If these methods aren’t working, you could try turning off your cache plugin. To do this, you just need to deactivate it by heading to Installed Plugins and then click Deactivate on your cache plugin.
CDN Isn’t Enabled
CDN utilizes distributed edge servers to send your content across the globe. When users go to your site, a host server is used to enable access. Even if traffic on the server is high, users still try to access the same host server which slows down your site. CDN assists with its large network. It will cache any permanent content and keep it on a server. If traffic becomes slow, the user can be redirected to this server.
The CDN content may not always update when you make changes to your static content.
Cache plugins are used to enable CDN. Bypassing the CDN could solve your issue, so you could try disabling it temporarily, by heading to the General Settings of your W3 Total Cache plugin and unticking the CDN option. This should solve your issues so you should be able to see all changes in WordPress as you make them and eliminate the error message.
Manually Rename the Site’s Fastcgi Cache Folder
Nginx uses a different user group on the server rather than the one in the fastcgi cache folder. This can make it a tricky folder in WordPress and cause problems and error messages such as ‘Publishing failed’.
Remove the fastcgi cache folder to solve this issue. When your server next wants to cache something, it will automatically create it in the right place withno need to restart PHP, Nginx, or anything else.
You can find your fastcgi cache folder in an Nginx config file
where it’s defined with a fastcgi_cache_path operator. The command below should help you find exactly where this operator is in your Nginx.
Log into the WordPress server of your site with a root OR with a sudo user. Then run this command:
grep -rnw '/etc/' -e 'fastcgi_cache_path'
The output should look something like this:
/etc/nginx/sites-available/allthings.conf:2:fastcgi_cache_path /var/www/cache/fastcgi levels=1:2 keys_zone=allthings:100m inactive=50m; /etc/nginx/sites-available/allthings.conf:90: # Define memory zone for caching. Should match key_zone in fastcgi_cache_path above. /etc/nginx/sites-available/allthings.conf:208: # Define memory zone for caching. Should match key_zone in fastcgi_cache_path above.
The above example clearly shows that you’ll find your fastcgi_cache-Path in allthings.conf, an Nginx configuration file. The fastcgi cache folder is then /var/www/cache/fastcgi.
Your fastcgi cache folder won’t be in the same place as in the example given which is only to show you how the output will appear. You’ll need to search for your folder.
Renaming your fastcgi cache folder:
When you find your fastcgi cache folder on the Nginx server, you can rename it by running this command.l. Then Nginx will recreate it automatically with the right permissions.
sudo mv /path/to/cache/fastcgi /path/to/cache/fastcgi.old
In the code above edit ‘/path/to/cache/fastcgi’ to be the location of your fastcgi cache folder that you found in the previous step.
Once you’ve run the command above, your folder will be renamed and will have a .old extension.
The Cause is Gutenberg Editor
To solve the problem of the WordPress ‘Publishing failed’ error, go back to the original WordPress editor rather than returning to an old WordPress version. Try this if you’ve been using the new Gutenberg editor instead of the usual WordPress editor.
Simply deactivate the Gutenberg editor. This should solve your error message problem and get your page back to normal.
How do you disable Gutenberg?
- First, you’ll need to install the plugin Classic Editor
- Activate Classic Editor
This will cause your WordPress to go back to using Classic Editor rather than Gutenberg. You can now resume publishing or editing your posts and pages as normal. If you’ve downloaded the plugin but can’t see Classic Editor, you’ll need to go to your settings, then go to writing and tick Classic Editor as the default editor.
Reactivate Your Plugins
One of the first methods to try to resolve your ‘Publishing failed’ WordPress error is reactivating your plugins by deactivating all of your site’s plugins. Then you can test and reactivate them one by one.
Turn on Debug Mode
If your WordPress post failed to publish, another solution is to activate debug mode, which may help you find out the cause.
define('WP_DEBUG', true);
If you want to turn it off again, just take out the code or you can change “true” to “false” in the code.
define('WP_DEBUG', false);</li>
Deactivate HTTPS
HTTPS may be causing the failure of your WordPress updating. In this case, follow these steps to resolve the error:
- Turn off the automatic HTTPS redirect (You can turn it back on after you publish successfully).
- Click save.
- Open up the WordPress Page with an HTTP connection (http://website.com/wp-admin)
- Save it and try to publish a page or post.
- Enable HTTPS again.
Change the Permalinks
If the WordPress updating failed error appears and you are unable to publish, try this quick fix:
- Click Settings and then Permalinks
- Once on the “Permalinks Settings” page, don’t edit anything just click “Save changes”
This simple action can cause WordPress to change and fix the .htaccess file. Navigate to the editor, change something and click “Save draft”, which may successfully remove the error.
Change to Full SSL from Flexible SSL on Cloudflare
If your WordPress update failed and you use Cloudflare, you can try switching to “Full SSL” in the SSL/ TLS settings> Overview tab.
If you enjoyed reading this article on how to fix the WordPress publishing failed, you should check out this one about how to fix the WordPress missing a temporary folder.
We also wrote about a few related subjects like jQuery is not defined, cannot login to WordPress, fixing the defer parsing of JavaScript, WordPress stuck in maintenance mode, WordPress sorry, you are not allowed to access this page and how to fix the http error when uploading images to WordPress.