From time to time you may want to update your WordPress installation to the latest version. You might want to do this because you’ve seen a message at the top of your Dashboard telling you that a new release is available, because you’ve been made aware of some useful new functionality, or because a security fix has been released.
Whatever the reason for updating, before getting started it is best to check the current minimum requirements page first to make sure that your web host has the required versions of PHP and MySQL. (If you are not sure, then your hosting provider should be able to tell you.)
The next thing to do is to take a backup of your database. All your posts and Pages are held in the database, so you will need to have a copy of it in case, for whatever reason, you change your mind after upgrading and need to go back. If you are not sure how to backup your database, then complete instructions can be found in the WordPress Backups section of the Codex.
The final preparation step is to disable plugins. Now, you don’t have to do this, but every now and again a plugin hasn’t been updated to work with the latest version of WordPress, and causes a problem after the upgrade. So, it’s best to try and avoid that, yes? You can easily disable your plugins by heading to the Manage Plugins page in the Dashboard, changing the “Bulk Actions” pull down menu to “Deactivate” and clicking “Apply”.
Now that you’ve checked that you’re ready to update, you’ve turned off your plugins and you’ve got your backup, it’s time to get started.
There are two methods for updating – the easiest is the Automatic Update, which will work for most people. If it doesn’t work, or you just prefer to be more hands-on, you can follow the manual update process.
Current versions of WordPress (2.7+) feature an Automatic Update. You can launch the automatic Update by clicking the link in the new version banner (if it’s there) or by going to the Tools -> Upgrade (or Update for version 3) menu. Once you are on the “Update WordPress” page, click the button “Update Automatically” to start the process off. You shouldn’t need to do anything else and, once it’s finished, you will be up-to-date.
For Automatic Update to work, at least two criteria must be satisfied:
(a) file ownership: all of your WordPress files must be owned by the user under which your web server executes. In other words, the owner of your WordPress files must match the user under which your web server executes. The web server user (named “apache”, “web”, “www”, “nobody”, or some such) is not necessarily the owner of your WordPress files. Typically, WordPress files are owned by the ftp user which uploaded the original files. If there is no match between the owner of your WordPress files and the user under which your web server executes, you will receive a dialog box asking for “connection information”, and you will find that no matter what you enter in that dialog box, you won’t be able to update automatically.
(b) file permissions: all of your WordPress files must be either owner writable by, or group writable by, the user under which your Apache server executes.
On shared hosts, WordPress files should specifically NOT be owned by the web server. If more then one user owns different files in the install (because of edits made by deleting and re-uploading of files via different accounts, for example), the file permissions need to be group writable (for example, 775 and 664 rather then the default 755 and 644). File permissions (in general) should be adjusted as appropriate for the server environment (the shared host RackSpace CloudSites for example recommends 700 and 600 for a single ftp user, or 770 and 660 for multiple ftp users). See the file permission section for more (some files and folders require stricter permissions).
Automatic update has been known to fail if you’re not using PHP5. If you see the message indicating that the update is downloading the zip file and then nothing else happens, it may be because you are not running PHP5. Many hosts offer both PHP4 and PHP5, and switching is usually very easy, often a simple entry in your .htaccess file. If you can’t switch to PHP5, and experience this problem, use the manual update below.
If you have customized the TwentyTen or TwentyEleven theme, you should not use the automatic upgrade, as it will overwrite your changes – you should use a manual update instead.
If you see a “failed update” nag message, delete the file .maintenance from your WordPress directory using FTP. This will remove the “failed update” nag message.
If the automatic upgrade doesn’t work for you, don’t panic! Just try a manual update.