In software world, applications need continuous update to protect against hackers and works with latest technology. WordPress works with core PHP files that helps to assemble the page layout from theme / plugin files and shows content from database. In order to keep your site safe and secure, you have to keep PHP, WordPress core, theme, plugins and database updated to the latest versions. Though the update works smoothly in many cases, you may get different errors if there are conflicts or problems. If you are struck with unable to update, here are some solutions to fix update failed errors in WordPress.
Keeping Your Site Up to Date
There are two steps to keep your WordPress site updated:
- You need to update the PHP and database versions using your hosting account as the server needs to support the latest versions. We will not focus these updates in this article and you have to get your host help in case of problems.
- You can update WordPress core, themes and plugins by logging into your frontend WordPress admin panel. Here , we will focus on the problems arising due to these updates.
How to Update WordPress Core, Themes and Plugins?
Login to your WordPress admin panel and navigate to “Dashboard > Updates” section. Here you can find if there are new versions of themes, plugins and WordPress available for update.
For WordPress versions update, you will see a notification in the dashboard mentioning there is an update available.
In addition, you can also click on the “Check Again” button to check whether any new updates are available. Similarly, you can check and update themes and plugins to the latest version.
You can update themes from “Appearance > Theme” and plugin from “Plugins > Installed Plugins” section. The advantage is that, you can enable automatic update for plugins and themes from these section. However, the item should be available in WordPress repository for you to use auto update feature.
Update Failed Errors
Whether you are trying to update core WordPress, theme or plugin, the update can fail due to various reasons. Since every WordPress installation is different consisting of different themes and plugins, you may get errors specific to your installation. This will be a problem for users as you can’t get quick help for your specific problem. Therefore, first check the error message and try to understand the reason so that it is easy to fix the issue.
In addition, we recommend you to disable auto update for plugins and themes to avoid unexpected downtime or layout broken issues. You can always check the change log and update manually by understanding the changed functionalities that may affect your site in advance. If you are struck with site down or layout broken after an update, check out our articles on how to revert back WordPress core to older version. It is also possible to revert back the plugins and theme to earlier version to restore the site to working condition.
How to Fix Update Failed Errors in WordPress?
Here are some of the possible solutions to fix update failed errors WordPress.
- Check WordPress server connection
- Update max_execution_time
- Check PHP version
- Disable security and caching plugins
- Conflicting theme, plugin with WordPress
- Manually update WordPress
- Check localhost settings (Force HTTPS)
1. Server Connection
As you can see in the below screen, when you try to update WordPress core or theme/plugin from WordPress repository, your site will try to connect to WordPress.org site. Some countries block WordPress.org website. Hence, you may get timeout error after clicking on the update button.
When your connection failed to contact WordPress.org server, you will get error like “Update Failed: Connection lost or the server is busy. Please try again later.”
Make sure you can able to access WordPress.org website (you can use VPN if it is blocked) and try to update again.
2. Unstable Installation Connection
For any update, WordPress will put your site in maintenance mode till the completion of the update. Unstable or interrupted internet connection may affect the download from WordPress.org or the developer’s site and terminate in-between. You will get errors like “Download failed: cURL error 18: transfer closed with xxxx bytes remaining to read. Installation Failed”.
In such case, you can try again when the internet connection is stable. Alternatively, you can also update the plugin or theme manually by downloading directly from WordPress.org or developer’s site and uploading through FTP.
3. Update max_execution_time
As mentioned, WordPress works with PHP and there is a parameter to define the maximum execution time of PHP files on your site. This parameter is called max_execution_time and most hosts will limit this to 1000ms. When you update a plugin or theme, WordPress will show a message “The update process is starting. This process may take a while on some hosts, so please be patient.”
If the update runs longer time it may fail with error like “Update Failed: Download failed. cURL error 28: Operation timed out after xxxx milliseconds with xxxxout of xxxx bytes received”.
In this error, the important part is the number of milliseconds which is the limit of PHP script execution time. The simple solution is to add the following line in your php.ini file (you can create php.ini in your root installation, if the file is not existing). Change 300 seconds to any preferred value that you would like to allow.
max_execution_time = 300
Few hosting companies like SiteGround also offer PHP variable manager in hosting account. You can use this app to setup the memory and execution limit.
Warning: Allowing bigger value for PHP execution time may result in violation of your hosting account terms. Most companies control this at server level that your limit will not be effective beyond the maximum allowed level for your account. You can discuss with host before changing this value yourselves.
4. Check File Permission
During update, existing files are overwritten and sometimes new files are also added. Modifying and adding new files need proper permission on the server. There are some security plugins that help you to change the file permission from admin panel to prevent accidental update and track the file changes. Setting wrong file permissions can prevent you to update WordPress core, your theme or plugin.
Generally, the file permission for wp-content should be 755. If you are not aware, check with your host for helping in resetting the permissions for you. Also, check out the WordPress documentation on changing file permissions.
5. Check PHP Version
WordPress needs the latest PHP version in order to work properly. On other hand, many old themes and plugins will simply not work with the latest PHP version. Many users continue to use old PHP version in order for their old theme or plugin to work.
Check your PHP version is the latest or within support period. You may need to get rid of the outdated theme and plugins and update the PHP version before trying to update any other stuff on your site. In addition, check the requirements for the updated version and confirm your current installation has all needed requirements.
In most cases, using deprecated PHP version may result in white screen of death or fatal PHP errors. This will bring your site down and you have to restore the backup to quickly bring the site online back.
6. Disable Security and Caching Plugins
Security and caching plugins can cause more trouble than good if you do not know how to use them properly. For example, below is one of the errors after updating mentioning security plugin or htaccess entry is preventing REST API. Therefore, if you face any problems in update, first clear the cache and then deactivate the security and caching plugins. This can help you to update without errors.
After successful update, you can reactivate the plugins back.
7. Try Manual Update
If the update fail continuously without any specific reason, you can try to update the stuff manually. First, make sure to setup maintenance mode for your site and login to your hosting server with FTP account.
- Theme update – delete your old theme under /wp-content/themes/ folder and upload the updated theme files.
- Plugin update – delete your old plugin under /wp-content/plugins/ folder and upload the updated plugin files.
- WordPress update – download the latest version from WordPress.org and replace your wp-admin, wp-includes and independent files in the installation root. Make sure not delete any content under your old wp-content folder.
8. Check Localhost Settings
If you are struggling to update theme or plugin or WordPress core in localhost site, there could be different reasons.
- Check HTTP and HTTPS connections are working fine on your local site and browser. Some localhost applications and browsers force using HTTPS that could create problems in updating the files.
- Check you have proper file permissions to update content on your computer.
- Disable caching and security plugins to avoid conflicts.
Keeping WordPress core, themes and plugins up to date is one of the routine maintenance tasks for WordPress site owners. Having outdated stuff is a security risk and you can find warnings in the Site Health section. However, you may get different errors while updating the files on your site. We hope the above solutions give an idea on fixing the issue. Otherwise, you have to contact the developer or hosting support for getting help.