Despite remaining on the WordPress 4.9.x branch and telling WordPress, via the config file, to only allow minor upgrades within that branch, the admin dashboard has a large Update Now button which will upgrade you to WordPress 5. Today I had an accident and clicked this button when I intended to click the Update Plugins button.
I did this when slightly distracted. Once the upgrade process has started you can’t stop it; you have to wait until the upgrade finishes and then downgrade.
Fortunately the process of downgrading is fairly straightforward; however, before starting, make sure you have a good backup of your database and all of the files.
- Most guides on downgrading WordPress tell you to deactivate all plugins before you do so, but I forgot to do this and suffered no ill effects.
- Delete the wp-admin and wp-includes folders.
- Download the no-content zip file for the version of WordPress to which you want to downgrade (such as http://wordpress.org/wordpress-4.9.9-no-content.zip).
- Extract the content of the above zip and upload to your site (overwrite the files in the site’s root folder as you do so).
- Log into the admin dashboard.
- When prompted for a database update, click Update WordPress Database
Once the database update is complete, click Continue and your site should be back to the downgraded version.