Upgrading WordPress should be a simple task if it’s maintained and updated over time and adapted to each major version with the requirements of that moment.
What happens with older versions?
As a courtesy, the WordPress project makes an effort to provide security support from WordPress 4.7 to the latest version. However, backporting patches is not always possible and therefore versions of WordPress prior to the very latest version are not officially supported as a result.
Each version has its own supported databaseDatabase A database is an organized collection of data. Access to this data is usually provided by a “database management system” (DBMS) consisting of an integrated set of computer software that allows users to interact with one or more databases and provides access to all of the data contained in the database. Because of the close relationship between them, the term “database” is often used casually to refer to both a database and the DBMS used to manipulate it. versions, PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response. versions, and a series of compatibilities that need to be updated over time.
What if it is not updated?
On this page there are some ideas and suggestions on how to upgrade. In many cases it will not be possible to upgrade the operating system, include new PHP versions, so you will have to migrate WordPress to an updated hostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web..
Many assumptions will be made in this document, as each case will be different. Before doing any kind of upgrade, please make a backupBackup A backup is a copy of computer data taken and stored elsewhere so that it may be used to restore the original after a data loss event. Backups can be used to recover data after its loss from data deletion or corruption, or to recover data from an earlier time. Backups provide a simple form of disaster recovery. of all site data: WordPress files, Database, Certificates and OS / Services configurations.
IMPORTANT: This is a very manual process, not a massive one. There will probably be losses and some updates will be needed after the upgrade.
In case only a major version (X.X) is indicated, use its minor (X.X.x) latest version available.
Using WP-CLI for upgrades
If WP-CLIWP-CLI WP CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. is available on your hosting environment, some parts of the upgrade process can be simplified. Always make sure you have a full backup of the files and the database before running any commands.
Check the current state of the installation before touching anything:
wp core version
wp core verify-checksums
verify-checksums confirms the coreCore Core is the set of software required to run WordPress. The Core Team builds WordPress. files match the official release, so modified or infected files surface before the upgrade instead of being blamed on it afterwards.
To see which newer versions are available before deciding on the upgrade path:
wp core check-update
Take a full backup before going any further. The Reliability page links to the backup documentation, including backing up your database and backing up your WordPress files.
Upgrading to a specific version
The upgrade paths on this page move through intermediate versions rather than jumping straight to the latest release. WP-CLI can pin each hop:
wp core update --version=X.X.X
wp core update-db
wp core version
Run these once per hop, following the target versions listed in the sections below, and check the site between hops. wp core version should print the version you asked for: if the version you give is not newer than the installed one, WP-CLI reports success without changing anything. For CLICLI A command-line interface (CLI) processes commands to a computer program in the form of lines of text. Today, many users rely upon graphical user interfaces and menu-driven interactions (WordPress WP-Admin). However, some programming and maintenance tasks may not have a graphical user interface and may still use a command line (WP-CLI).-based upgrades, run update-db after each core update so database schema changes are applied before continuing to the next hop.
The sections below name a branch, such as 4.9. For each hop, replace X.X.X with the newest release of that branch from the WordPress releases page, for example the newest 4.9.x for a hop to 4.9.
wp core update-db --network so the databaseDatabase A database is an organized collection of data. Access to this data is usually provided by a “database management system” (DBMS) consisting of an integrated set of computer software that allows users to interact with one or more databases and provides access to all of the data contained in the database. Because of the close relationship between them, the term “database” is often used casually to refer to both a database and the DBMS used to manipulate it. upgrade runs across all sites.After the final hop, run wp core verify-checksums again to confirm the files match the release.
Recovering from a stuck or broken upgrade
If an update gets stuck or fails partway, force WP-CLI to re-run the same versioned core file update:
wp core update --version=X.X.X --force
Use the same --version value as the hop you were trying to complete.
If the command stops with “Another update is currently in progress.”, an earlier run left its lock behind. The lock expires on its own after 15 minutes, or you can remove it:
wp option delete core_updater.lock
If the site keeps showing “Briefly unavailable for scheduled maintenance. Check back in a minute.”, an interrupted update left a .maintenance file in the WordPress root directory. WordPress ignores the file once it is 10 minutes old. To clear the message right away, delete the file or run:
wp maintenance-mode deactivate
To re-download the core files without replacing the wp-content directory, for example when verify-checksums keeps reporting modified files:
wp core download --version=X.X.X --force --skip-content
Set --version to the version the site is on, as shown by wp core version, or to the earlier version you are rolling back to. Without --version, WP-CLI downloads the latest release instead, which would skip the remaining hops. This changes files only; it does not roll back database changes, so restore from a backup if wp core update-db has already run and you need a full rollback.
Older installations
The current WP-CLI release does not run on the PHP versions that ship with the oldest WordPress installations. Earlier WP-CLI releases remain available as Phar downloads on the WP-CLI releases page, and the manual steps in each section below work without WP-CLI.
For the latest and complete list of wp core commands and options, please refer to the official WP-CLI documentation:
Upgrading from WordPress 0.7 – 3.6 (by migration)
Goals:
- WordPress: upgrade to WordPress 6.2
- PHP: upgrade to PHP 7.4
- SQL: upgrade to MySQL 8.0 / MariaDB 10.11
Losses:
- Content: none
- Plugins: all
- Themes: all
These are the oldest versions of WordPress and the ones that have not been supported for years. In general, you have to assume some losses, although not of the contents, but probably of some functionality on themes and plugins.
Considering that the goal is to keep the contents and assuming the loss of the rest of the elements, there are some steps.
As with any upgrade, the first thing to do is to make a backup copy. The best way to upgrade from WP < 3.6 is to perform a content migration.
- Create a brand-new WordPress, without the database.
- Copy the old WordPress files from the “/wp-content/uploads/” content to the new one.
- Create a new database with the old database information. The best way is using “mysqldump”.
- Configure the wp-config.php with all the new data.
- Access the “/wp-admin/” page, and follow the upgrading process.
This way, WordPress will be able to maintain and update the contents in the database and be able to work with these contents in an updated version of WordPress.
A WordPress with the default theme, and all the contents should now be available.
Character Encoding commonly presents technical hiccups when restoring a database. It is possible that backup data is not encoded in UTF-8 and instead may be in an ISO or ASCII “deprecated” format. Make sure that the character encoding is updated correctly upon restoring a database! More information on converting Character Sets in a WordPress database can be found here.
Upgrading from WordPress 3.7 – 4.0
Goals:
- WordPress: upgrade to WordPress 4.1
- PHP: upgrade to PHP 5.6.20+
- SQL: upgrade to MySQL 5.6 / MariaDB 10.0
Losses:
- Content: none
- Plugins: probably yes
- Themes: probably yes
WordPress Versions <= 4.0 are compatible with PHP versions that are hardly available today. They can range from PHP 5.2 (or even earlier) to PHP 5.5.
WP-CLI does not work below PHP 5.6.20, so this update must be manual.
Follow these steps:
- Back up everything
- Remove unused themes
- Activate Twenty Ten
- Delete deactivated plugins
- Deactivate all active plugins
Then overwrite the WordPress Core with WordPress 4.1.
Upgrade PHP to 5.6.20+ and SQL to MySQL 5.6 / MariaDB 10.0.
Access /wp-admin/ and complete the upgrade.
Proceed next to WordPress 4.9 upgrade.
Upgrading from WordPress 4.1 – 4.8
Goals:
- WordPress: upgrade to WordPress 4.9
- PHP: upgrade to PHP 7.2
- SQL: maintain or upgrade to MySQL 5.6 / MariaDB 10.0
Losses:
- Content: none
- Plugins: probably yes
- Themes: probably yes
Follow the cleanup process again:
- Remove unused themes
- Activate Twenty Ten
- Delete unused plugins
Overwrite WordPress core with WordPress 4.9.
Upgrade PHP to 7.2.
Proceed next to WordPress 5.3 upgrade.
WordPress 4.9 – 5.2
Goals:
- WordPress: upgrade to WordPress 5.3
- PHP: upgrade to PHP 7.4
- SQL: upgrade to MySQL 8.0 / MariaDB 10.3
Losses:
- Content: none
- Plugins: probably no
- Themes: probably no
Major notes:
- WordPress 4.9 was the last Classic Editor version.
- WordPress 5.0+ fully supports Classic Editor content.
Follow the same cleanup steps:
- Activate Twenty Ten
- Deactivate plugins
- Replace core with WordPress 5.3
Then upgrade PHP to 7.4 and SQL to MySQL 8.0 / MariaDB 10.3.
WordPress 5.3 – 6.2
Goals:
- WordPress: upgrade to WordPress 6.2
- PHP: upgrade to PHP 7.4
- SQL: upgrade to MySQL 8.0 LTS / MariaDB 10.11 LTS
Losses:
- Content: none
- Plugins: no
- Themes: no
Upgrade normally. Everything should work.
WordPress 6.3 – 7.1
Goals:
- WordPress: upgrade to WordPress 7.1
- PHP: upgrade to PHP 8.4
- SQL: upgrade to MySQL 8.4 LTS / MariaDB 11.4 LTS
Losses:
- Content: none
- Plugins: no
- Themes: no
PHP changes:
- WP 6.3 dropped PHP 5.6
- WP 6.6 dropped PHP 7.0 & 7.1
- WP 6.6 requires PHP 7.2.24+
- WP 7.0 dropped PHP 7.2 & 7.3
- WP 7.0 requires PHP 7.4+
Upgrade normally. Everything should work fine.