Have you been struck by the infamous WordPress updating failed error? You are working on an important project near the deadline and suddenly the error strikes?
This error doesn’t clearly describe why this happens. But generally, it seems to happen whenever you want to publish or update a file.
WordPress is used by more than 455 million sites worldwide. When a number is this big even a tiny percentage translates to a lot of people. This error might seem mysterious to newcomers and would seem hard to fix. But once you know the reason, it becomes quite easy to understand.
Today we will discuss the reason behind this error and what you can do to fix it. Along with that, we would also discuss ways to lessen the chances to get this error in the future.
What are the Causes of WordPress Updating Failed/ Publishing Failed Errors?
This error happens when the Web application (WordPress) can’t connect to the WordPress API. API short for Application Programming Interface is a method in which an application connects to an API to execute a function.
In this case, the App would connect to the WordPress database via the API to make changes to it. But for one reason or another, when the application is unable to connect to the API, the infamous “Updating Failed” or “Publishing Failed” error pops up.
WordPress uses the Block Editor to edit its pages and the Block Editor connects to the API and makes the changes.
Why is WordPress unable to use REST API?
Several things can go wrong during the connection procedure with the API. Even though you might not have done anything wrong, several things in the background might have gone wrong that might have caused this issue.
Your internet might have turned off in the background or your WiFi might have malfunctioned.
Besides simple reasons like these, there are also some technical reasons. If you use a plugin the plugin might have interfered and caused this issue. The API might be blocked by your firewall and it might have led to this issue.
Let’s know a few reasons why this error happens-
- Network Error: If you have a bad network connection or if your network is temporarily down, this message would pop up. But this can be easily fixed.
- Plug-in error: Various Plugins can inhibit the function and can cause the API to misbehave. You need to find the plugin and delete it to restore normal function.
- Firewall Error: Firewalls protect your site from various hacking attempts. But this can sometimes block the REST API. When this happens, you get greeted with the infamous error message in WordPress.
How to Troubleshoot and Fix the WordPress Updating failed error
Now that we know what caused this error, let’s get to know how to solve this problem. We have gathered six steps to fix this issue.
Step 1. Check Your Internet Connection and Site URL:
First of all, you need to make sure your Internet is running. To make sure you can open a new browser window or tab and check if the internet is running by going to any website or you can try speed testing as well to check if your Internet connection is fine.
If the Internet connection is not the problem, the problem might be with the site URL.
- To check the site URL, navigate to Settings> General Settings.
- Now check your Site URL and your WordPress URL.
- Make sure it is correct. If the URLs are not correct, that might be the reason for this problem.
However, if they are correct something else might be the problem.
Step 2. Check REST API Status Using WordPress Site Health
You can check the status API in WordPress itself. The process is quite simple. The Site Health utility built into WordPress grants you various information about various aspects of your site.
Accessing this utility is fairly easy. To access it
- Navigate to Tools > Site Health from the WordPress Panel.
- If it shows ‘The REST API encountered an unexpected result’, there might be something wrong with the service. If it shows some details about why this error happened you should work on that aspect.
The Debugging data is very useful in this case as it practically tells us what the issue is. However, if it doesn’t provide any information follow the following steps accordingly.
Step 3. Disable All Your WordPress Plugins
As we already discussed, plugins can sometimes mess with some of the functions. And this might lead to an error.
Sometimes the Site Health utility will tell you that Plugins are causing the REST API to misbehave. To fix this follow the steps below-
- Click on Plugins in the left menu bar
- Now go to installed plugins.
- Select Bulk Action from the drop-down menu
- Deactivate all the Plugins at once. And click on Apply.
- Now start making changes again and activate the plugins one by one and try to make changes to a page every time.
- Find the plugin that malfunctions this way and delete that Plugin.
- If you find those Plugins you can report and review that Plugin, this way other people don’t can avoid this issue.
If your issue is not fixed by this procedure, continue with this review and try the other procedures.
Step 4. Check Website Firewall Service
A firewall is exactly what it sounds like. A firewall saves the network from connecting to malicious or potentially malicious servers. In addition to Computers, firewalls are also available for Websites and WordPress Sites. Firewalls provided by Cloudflare and Sucuri are such firewalls.
These firewalls might block the REST API sometimes. This happens for various reasons. If you are currently receiving a DDoS attack, the Firewall might block API access. But if that is not the case, your IP address might be deemed suspicious by the Firewall provider.
This can happen if you are using VPN and immediately connecting to WordPress. Or simply if you live in an area that is considered suspicious.
Services like Cloudflare can be temporarily disabled. This way you can see if this is the problem. The Cloudflare menu can be found in the Domains section in WordPress hosting. This will vary from hosting to hosting, so consider checking out tutorials or documentation of your Hosting service.
Step 5. Enable and Review WordPress Debug Log
The Debug log is a great way to identify and solve problems in your WordPress hosting. This allows you a deeper insight into the problems that occur. WordPress logs various errors but unfortunately, it doesn’t log REST API errors.
But why are we told to check the Debug log then? Although the Debug log doesn’t have a log of REST API errors, you can see other errors that took place and find out if that errors might be correlated with the REST API. To do that you would have to work a little.
- First, you would have to add some lines to the wp-config.php file.
- Add these lines to the file.
"// Change WP_DEBUG to true define( 'WP_DEBUG', true ); // Keep a log of WordPress errors define( 'WP_DEBUG_LOG', true );"
- Now save and upload the file to your server.
- Updated or Public a page to reenact the error.
- Connect to your WordPress site server with an FTP client (you would need your FTP Server address and Password)
- Navigate to /wp-content/ in the FTP Server.
- Download debug.log from /wp-content/
- Open the log file with Text Editor or compatible software.
- Search for a plugin or theme file name and read the error next to it.
- Try to understand the error, if you can’t get help from professionals or online help. You can use Reddit or online forums.
Step 6. Temporarily Switch to the Classic WordPress Editor
If you don’t want the hassle and need to publish immediately, there is a workaround. You can bring back the old WordPress Editor. This Editor doesn’t need the REST API. So, you can publish the site without even accessing the API.
To bring back the Classic WordPress Editor, we need to follow some relatively easy steps.
- You need to first install the Classic Editor Plugin.
- After installing, you need to activate the plugin.
Now you can freely edit and publish without even worrying about the error. You can edit just the way you normally do but the error won’t bother you now.
Final Step: Ask for Support
Can’t seem to solve the issue even after following all the steps and doing them step by step? Don’t be disheartened.
WordPress is a very big platform. Almost 43% of all websites in the entire world are hosted by WordPress.
So, there is a good chance someone else encountered the problem and it is already solved.
You can search for the problem on the web to go to various forums and guide pages and try their solutions.
If the solution is not posted, you can be the one to post it. Go to various subreddits, communities, and forums that deal with these problems and post your question where someone experienced can solve your problem.
There is also WordPress Support, Support from your respective hosting service, and also WordPress Forums you can visit.
Is there anything we left out? We discussed various ways to solve the “Publishing Failed” or “Updating Failed” error of WordPress. We hope using this article you will be able to get rid of this annoying error once and for all.