includeonlydiv style=clear:both; background-color:#FFDCDC; border:1px solid #bb0011; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;WARNING: The upgrade process will affect all files and folders included in the main WordPress installation. This includes all the core files used to run WordPress, two plugins (Akismet and Hello Dolly) and the standard themes (Twenty Thirteen, Twenty Twelve, etc.). If you have made any modifications to those files, your changes will be lost./div/includeonlynoinclude
This Template is used by Codex:Template Messages.
pre 检查到模板循环：模板:Message /pre
You should always update WordPress to the latest version. When a new version of WordPress is available you will receive an update message in your WordPress Admin Screens. To update WordPress, click the link in this message.
Back up WordPress
Before you get started, it's a good idea to back up your website. This means if there are any issues you can easily restore your website. Complete instructions to make a backup can be found in the WordPress Backups section of the Codex.
Ready to Update
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).
If you have customized a standard theme (Twenty Twelve, etc.), 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.
These are the short instructions, if you want more check out the extended upgrade instructions. If you experience problems with the Three Step Update, you may want to review the more detailed upgrade instructions
For these instructions, it is assumed that your blog's URL is
Step 1: Replace WordPress files
- Get the latest WordPress zip (or tar.gz) file.
- Unpack the zip file that you downloaded.
- Deactivate plugins.
- Delete the old
wp-admindirectories on your web host (through your FTP or shell access).
- Using FTP or your shell access, upload the new
wp-admindirectories to your web host, overwriting old files.
- Upload the individual files from the new
wp-contentfolder to your existing
wp-contentfolder, overwriting existing files. Do NOT delete your existing
wp-contentfolder. Do NOT delete any files or folders in your existing
wp-contentdirectory (except for the one being overwritten by new files).
- Upload all new loose files from the root directory of the new version to your existing wordpress root directory.
NOTE - you should replace all the old WordPress files with the new ones in the
wp-admin directories and sub-directories, and in the root directory (such as index.php, wp-login.php and so on). Don't worry - your wp-config.php will be safe.
Be careful when you come to copying the wp-content directory. You should make sure that you only copy the files from inside this directory, rather than replacing your entire wp-content directory. This is where your themes and plugins live, so you will want to keep them. If you have customized the default or classic themes without renaming them, make sure not to overwrite those files, otherwise you will lose your changes. (Though you might want to compare them for new features or fixes..)
Lastly you should take a look at the wp-config-sample.php file, to see if any new settings have been introduced that you might want to add to your own wp-config.php.
Step 1.5: Remove .maintenance file
If you're upgrading manually after a failed auto-upgrade, delete the file .maintenance from your WordPress directory using FTP. This will remove the "failed update" nag message.
Step 2: Update your installation
Visit your main WordPress admin page at /wp-admin. You may be asked to login again. If a database upgrade is necessary at this point, WordPress will detect it and give you a link to a URL like
http://example.com/wordpress/wp-admin/upgrade.php. Follow that link and follow the instructions. This will update your database to be compatible with the latest code. You should do this as soon as possible after step 1.
Step 3: Do something nice for yourself
If you have caching enabled, your changes will appear to users more immediately if you clear the cache at this point (and if you don't, you may get confused when you see the old version number in page footers when you check to see if the upgrade worked).
Your WordPress installation is successfully updated. That's as simple as we can make it without Updating WordPress Using Subversion.
Consider rewarding yourself with a blog post about the update, reading that book or article you've been putting off, or simply sitting back for a few moments and letting the world pass you by.
Your update is now complete, so you can go in and enable your Plugins again. If you have issues with logging in, try clearing cookies in your browser.
If anything has gone wrong, then the first thing to do is go through all the steps in our extended upgrade instructions. That page also has information about some of the most common problems we see.