Having to upgrade your WordPress install every time a new version is released is necessary, but also very boring. If you have a SSH access to your server, here’s a very quick way to upgrade your WordPress install.

This is probably the most important step of this whole tutorial: always backup your WP Database and files. This tutorial have been tested, however I won’t be held responsible for any kind of data loss.

Once done, you can connect to your server by using SSH. On Mac and Linux platform you can use the Terminal, on Windows I recommend using Putty.

Get the latest WordPress version available:

wget http://wordpress.org/latest.tar.gz

Uncompress it:

tar xfz latest.tar.gz

Delete the wp-admin and wp-includes directories:

rm -rf ./wp-includes/
rm -rf ./wp-admin/

Go to the wordpress directory:

cd wordpress/

Now, it’s time to copy the downloaded files to your existing WP install, by overwriting old files:

cp -rpf -f * ../

Once done, come back to the WordPress directory and remove the downloaded files:

cd ..
rm -rf ./wordpress/
rm -f latest.tar.gz

Visit your blog and upgrade the database (if needed). That’s all, your blog is now up to date and the whole process didn’t took more than a minute or two!

For more WordPress tips and tricks, you should definitely take a look at my blogs WpRecipes and Cats Who Code!

Jean-Baptiste Jung is a blogger/web developer/web designer who lives in the French-Speaking part of Belgium. Jean-Baptiste maintains two blogs: Cats Who Code.com where he and other authors write about Web Development, Web design, Blogging tips and WordPress, and WPRecipes.com where Jean shares useful WordPress snippets on a daily basis. When he's not blogging or having fun with codes, Jean loves to spend time with his wife and cat, and traveling everywhere he can.

  1. Austin says:

    If you have shell access, it’s faster just to use Subversion:

    svn export --force http://svn.automattic.com/wordpress/tags/2.6.5 .

  2. Fernando says:

    A simple question …

    why do you delete wp-includes and wp-admin?, I think that you must delete wp-content in order not to overwrite your theme, plugins, etc … but “wp-admin” and “wp-includes” :roll:

  3. KimC says:

    I’m sure you already know this but it bears mentioning: once you upgrade to WP 2.7 you will be able to upgrade automatically with a single click inside your dashboard.
    Freedom!

  4. Tom Ransom says:

    These instructions are incomplete and dangerous. A user following them will lose all their plugins and themes.

    And worse, presumes the user attempting this know enough to change to the correct directory on their server.

    • I agree that these instructions should say something like:

      1. login to ssh and cd to your workpress installation folder

      as their first instruction.

      and they should mention that if the user is using an updated version of either classic or default then should answer ‘n’ when prompted for permission to overwrite – however having said that these instructions have saved me hours today when I upgraded all my wordpress sites to 2.9.1.

  5. @Tom: Are you answering to Fernandos comment?

    Because your themes and plugins are in the wp-content directory.

    wp-includes and wp-admin are system-only files and deleting these dirs helps to prevent security-issues. You get a fresh reinstall of the system files. So old scripts are being deleted, which are not included in the main distribution anymore.

    SVN export is an elegant way for experienced users ;-)

  6. Jeremy says:

    Does the SVN method merely overwrite existing files throughout your install, or does it overwrite some, but also then entirely replace necessary folders like wp-admin and wp-includes (leaving no older files or anything else behind in those cases)?

  7. Austin says:

    Jeremy,

    svn export just overwrites; if you want to use Subversion to get rid of old files as well as get new ones, then you should check out a fresh install with svn co and then switch to new releases.

Trackbacks/Pingbacks »

  1. WordCast 39: Longer than a list of Madonna’s ex-boyfriends | WordCast - The web's best podcast on WordPress and blogging says:
  2. All Things Wordpress: Code Resources (Advanced) | THE REVENUE HERALD says: