Oh, Gutenberg, why did you do this to me?
We had been using Gutenberg since its release in WordPress version 5.0 and opted to use it until we had an opinion. The result was that we adapted quickly and even enjoyed the features of the new editor.
Though it seems our opinion was quite different from the average WordPress user:
Once the error occurred, I did my research and came up with some solutions that included things like creating the page and then insert the content or even putting all content within the same block. However, our philosophy does not allow such restrictive workarounds as this one, so I decided to debug on my own.
Why Did “Publishing Failed” or “Updating Failed” Happen?
The answer is not so simple and depends on analyses of a number of factors. According to my simulations, the problem occurs due to failed request responses when updating or creating a blog post. Most of the time these requests will return status code 5xx or 403.
Error 500 is most often associated with application problems such as conflicts between plugins, syntax errors of your theme, missing files, etc. Error 403 is associated with permissions issue and usually occurs when there is a server block.
The Quick Fix for “Publishing Failed” or “Updating Failed”
For those who need a quick fix or do not have the technical skills to debug, I strongly recommend disabling Gutenberg until you find out the cause of the problem.
There are several ways to do this and the most popular is through the “Classic Editor” plugin, which within a few days after the release of Gutenberg, reached over one million downloads.
Step 1 - Access the WordPress dashboard.
Step 2 - In the “Plugins” menu, look for “Add New”.
Step 3 - Search for "Classic Editor" and install the plugin under "Install Now" button.
Step 4 - After installation, click on “Activate”.
Done! By disabling Gutenberg, the issue will be temporarily resolved and you will be able to return to your normal activities within WordPress. That being said, I strongly recommend that you look for a definitive solution, as Gutenberg is becoming increasingly efficient, and managing content with it is becoming a must.
After the debug we've done, we've come to some general conclusions of what you can do to fix the problem completely on your own. If your website circumstances fit any of the options below, go ahead:
- Do you use any firewall (e.g., StackPath, Cloudflare, Sucuri, etc.)? If so, it is possible that the request is being blocked. To fix, simply whitelist your IP.
- Have there been any plugins updates recently? If so, there is likely to be some conflict. In these cases, you can disable all plugins and check if the problem persists by activating one by one.
- Has there been a theme update recently? In such cases, try switching to the default WordPress theme and check if the problem persists.
Debugging Like a Boss: “Publishing Failed” or “Updating Failed”
As explained earlier, the notices “Publishing Failed” or “Updating Failed” may appear due to a variety of internal issues: either due to a server block or an application problem. The first step in identifying the cause of the problem in an assertive and non-speculative way is to identify the response code of the request that updates or creates the posts. To do this, follow the steps below:
Step 1 - Access the post “Edit” page.
Step 2 - Open the “Inspect Element” tool and look for the "Network" tab.
Step 3 - With the "Network" tab open, click the WordPress “Update/Save” button. Most likely, a red request will be listed.
Step 5 - By clicking on this request, you will be able to analyze the “Headers” and then know the status code of the request. In our case, the problem happened because our firewall was blocking the user, so Error 403 was being displayed. We fixed it with a simple IP whitelist.
If you are receiving Error 403 but have no firewall installed (e.g., Cloudflare, StackPath, Sucuri, etc.), check if your application has a security plugin like Wordfence, for example.
Security plugins can block specific IPs based on suspicious activity, and this block is often injected directly into “.htaccess”. Therefore, simply whitelist your IP in this plugin or reset your “.htaccess” to its original version.
After brief research into the issue, we came up with a solution that doesn't restrict the functionality needed to continue running your site, and that's our biggest goal. In this article we seek to address a few solutions to the same problem so that we can help you, regardless of your technical knowledge.
If you are unable to fix the problem yourself, feel free to comment below and we will be more than happy to help you find a solution. Also, please share your experiences regarding this issue and let us know if you find any other solutions for this problem.