Are you concerned about upgrading your WordPress or wondering what should you do if anything goes wrong? Or you have already upgraded and it isn’t working normally. Don’t worry you have landed at the right place.
The WordPress core team works on release testing but it is very difficult to uncover every bug even for the experts.
Below are some common issues with the major upgrades:
- Your database upgrade remains incomplete.
- Plugins aren’t compatible with the new version.
- Your theme appearance gets changed after the update.
The reason may be anything and sometimes you need to revert back to the previous release and in this post, I am going to guide you on how to do just that.
But prior to that, I would first like to clear that though you can downgrade WordPress to a previous release but consider it as a temporary solution. You should always be on the latest WordPress release for several reasons. But the most important is that it ensures security holes are patched. When you run your site on an older version of WordPress, it gets exposed to security vulnerabilities. In this post you will learn to downgrade the WordPress version, please understand that these steps should be performed only temporarily until the issue gets resolved. You can get your latest WordPress version by just waiting for the next minor release of WordPress.
Understanding Your WordPress Site
At the start, let’s first check what builds your WordPress site. Your WordPress site is a collaboration of three main components. The first component is WordPress Core and these are all the files that help the WordPress to run. The second component is the content files and these are all the files that help your site stand unique and include your theme, plugin, and media files. Basically, they are everything you install or upload to your site. The third and final component that builds your site is the database. The WordPress database stores all data needed to run your site. This includes all the content that builds your posts, pages, settings, user logins and much more.
In case you have ever browsed your WordPress install using FTP, you may have noticed that your site is comprises of 3 main folders: wp-admin, wp-includes, and wp-content. The first two folders: wp-admin & wp-includes contain all of the PHP and configuration files that run WordPress. These are the WordPress core files. The third folder: wp-content comprises of the plugin, theme, and media files that you have either installed or uploaded. These are your content files.
Your database looks a bit like the image below. Your database is includes two components: the database definition(schema) and your site data. Remember that the WordPress core version and database definition version should always be the same for the site’s proper working.
After upgrading your WordPress version, only your database and the files in the wp-admin and wp-includes folders get updated. The files in the wp-content folder are get updated only when you update your plugins and themes.
Knowing all this is important because downgrading your site is a complex process for which you need a general understanding of what builds your WordPress Core and what builds your WordPress Content.
Step 1: Get a Complete Website Backup
When a backup is created using a plugin like WPBackItUp, only the content gets backed up. This means it includes only the wp-content folder and the database and not the WordPress core files. The purpose behind excluding the WordPress Core files is that they are freely available from WordPress.org. If those are included it would slow down the time for completing your backup and will make the backup unnecessarily large. Moreover, when a site is hacked malware may be injected into the core files so you should start with a fresh install whenever possible.
Taking a good backup of your website using the WordPress release you want to revert to is the first step in downgrading WordPress. Imagine your site is running WordPress 5.0 currently but have taken the last backup when your site was running 4.9.7, then you must downgrade your site to WordPress 4.9.7 prior to restoring your backup.
You shouldn’t restore a backup that was made on a different version of WordPress because your content and core files version won’t match and your site may become unstable.
So first check the version of WordPress when the backup was taken. If you are using WPBackItUp, you will get this information in the “backupsiteinfo.config” file. You will get this file in the backup zip file containing the word “-main-”.
After knowing the version of WordPress core you want to target, you can proceed with downgrading WordPress.
Step 2: Use WordPress Core to Downgrade WordPress
You can downgrade your core WordPress install by using the WP Downgrade plugin. Is is simple to use and its only function is to set the target WordPress version used by the core update routines. Check the below extract from its description in the WordPress directory.
The plugin “WP downgrade” forces the WordPress update routine to perform the installation of a specified WordPress release. The Core Release you specified gets downloaded from wordpress.org and installed as any regular update.
After you install WP Downgrade, you can set the targeted version of WordPress you would like to revert to. The image below represents a demo site running WordPress version: 5.0-alpha-43823. To downgrade this site to version 4.9.8, it is required to enter the version number in the “WordPress Target Version” field and then select the “save changes” button.
Once you save, WP Downgrade displays “Active (WP 4.9.8 is set as target version)” identifying the targeted WordPress version as 4.9.8. This indicates that WP Downgrade is working properly. The target version of WordPress to be installed has been set.
You find that there is also a new button available “Up/Downgrade Core”. It doesn’t actually perform the downgrade but simply takes you to the WordPress updates page you are already familiar with (below).
For downgrading, just click the “Update Now” button and let WP Downgrade and WordPress do the work. When the downgrade gets completed, all the core files get downgraded to the targeted version, in this case, it is WordPress 4.9.7.
Step 3: Restore your Content
Now since you have successfully downgraded your WordPress core files, you need to perform one more important step. It is to restore site content from your backup. This is important because while WP Downgrade has helped in successful downgrading of your core files, your database and content files aren’t downgraded. If you leave your site in this state, it can cause unexpected issues and so, restoring your backup is vital.
You can restore the backup using WPBackItUp Premium, by first clicking the “restore” option which will take you to the WPBackItUp Premium restore dashboard. Then, identify the backup you want to restore and click “restore”.
When the restore is completed, WPBackItUp Premium will have restored all your content (wp-content & database) to its original state. Your WordPress core files and file content will be in sync now.
Conclusion
In this post, you have learned about what builds up a WordPress site and why it’s important to understand prior to downgrading your WordPress version. Also, you will have learned about successfully downgrading your WordPress install step-by-step. To quickly recap, they are:
- Get a complete website backup.
- Use WordPress Core to Downgrade WordPress.
- Restore your content with WPBackItUp Premium.
If you have any questions about how to downgrade your WordPress install? Just type them in comments section below!