September 09, 2016

How to upgrade a WordPress theme

Upgrading your WordPress theme should be easy.  Here's a quick guide on several ways to upgrade your theme and what to do if it fails.

1.  What are the new features and changes?

If the theme author has released a list of new features or a changelog, you should take a quick look.  Often people are eager to update when there's no real need.  Honestly, why bother making an update that adds in twitter to your team member shortcodes when you aren't even using the team member shortcodes at all?  But still you'll have people jump at the sound of "Version 2.0."  These kinds of changes can mean a lot more work if you have custom templates or have modified theme files.

Of course if there's a security update, updating should be top priority.  But it's always good to check before creating needless work for yourself.  If it ain't broke, don't fix it.

2.  Make backups of your existing WordPress theme

This is by far the most important step in updating!  Do not be lazy and skip making a backup.  Think you're an exception?  Think again- here's a list of possible issues:

  • The new theme has an error in it and doesn't work at all
  • You or your developer accidentally made edits directly to theme files and now all your changes are gone
  • The new version is incompatible with one of your old plugins
  • Your child theme modifies a function or template that is no longer used

I could go on, but you get the idea.  These are all issues we've experienced first-hand with clients many times.  Take the extra two minutes to backup and you'll save yourself hours of work.

The best way to do this is login to your server using your favorite FTP client (we love Filezilla) and navigate to your themes folder.  For most hosts your path to this folder will look something like the following (the public_html portion may vary depending on your server and access rights):

public_html/wp-content/themes/

Once you're in the WordPress themes folder, look for the the folder name of your theme and right click and hit "Download."  This will download your current theme folder to your computer so you can safely continue updating.

3.  Installing the new WordPress theme

Installing a new theme is not terribly hard, but there are a few different options depending on your skill level and the theme involved.

Old school method / FTP

Login to your server again using your FTP client and navigate to the themes folder as described above.  Many people suggest simply dragging and dropping the theme into this folder and overwriting the existing theme, but do not do this.  This is just begging for issues and even if your FTP client manages to overwrite all files without error, template files removed in the new version could cause issues.

ftp

Instead you should rename the existing folder to 'themename-backup' and then upload the new theme folder.  Make sure the newly uploaded folder's name matches the previous theme folder of 'themename' or whatever your theme is called.

While your site may have a minute of downtime while the new files are uploaded, this method creates a backup of your old theme and I trust it far more than using any of the following methods.  Why?  Plugins that update themes rely on proper read & write permissions on your server that if not set correctly can corrupt your theme or even your install.  With this method you can see and control everything that's happening.

Plugin

There are several plugins available now that let you update the theme by uploading the zip in the WordPress dashboard.  Easy Theme and Plugin Upgrades is our go-to recommendation for the time being.

wordpress plugins - easy theme and plugins update

To update, just upload the zip file like you are installing the theme for the first time.

  1. Download the latest zip file for your theme.
  2. Log into your WordPress site.
  3. Go to Appearance > Themes.
  4. Click the "Add New" button at the top of the page.
  5. Click the "Upload Theme" button at the top of the page.
  6. Select the zip file with the new theme version to install.
  7. Click the "Install Now" button.

What's great is this plugin will automatically create a backup of your existing theme or plugin when you update in your media library.  

It's still worth noting that some users encounter fatal errors and corrupt sites with this method.  While it's rare, its still an area you should be cautious.  When this happens you should stay calm and contact a developer; it's usually a quick fix.  Please do not go on a rampage with the plugin author since these kind of issues are caused by your server and they have no control over it.

Automatic

If you're using a WordPress theme from ThemeForest you can automatically update with the Envato Toolkit plugin.  While this is a pretty straight-forward plugin, setup can be a little tricky since you need to login to your Envato account to generate an API key.  If you're interested in more detail on how to do this, WPExplorer has a great write-up on installing and configuring the Envato Toolkit.

If you've downloaded your theme from the WordPress repository on WordPress.org and you're running at least WordPress 3.7 (which you should be since it's already almost 3 years old), navigate to Dashboard->Updates and you'll see a full list of theme and plugin updates available.  Premium themes and plugins cannot be updated here, so you won't see them in the list.

4.  Troubleshooting

Accidents happen, but don't fret.  Your content hasn't gone anywhere and is still safe and sound in your database.  If there's no security updates with your new theme version, you can always reverse this process by uploading your backup and renaming it to the correct theme folder name.

Here are a few of the common complaints we see.

I lost my custom theme changes during update

If you made backups (you should have!) then there's no need to fear.  This means either your theme contains new functions or there were custom edits in your previous theme folder.  

Either way you can use a file comparison tool to find the differences quickly.  Try using Kaleidoscope if you're using OSx or ExamDiff if you're on Windows.  If you're on Linux, I'm not sure why you're even reading this- go find something more advanced.

These tools will pull up all the differences in files and let you pick and choose which ones you'd like to keep.  While I'm not sure they're really beginner level, they may at least give you a clue as to what went wrong.  And in the future, always keep your theme customizations in a child theme!

I got the WordPress white screen of death or an error message

For this one you may want to try and get in touch with a developer.  If you're feeling confident, login to your server with your FTP client and edit your wp-config.php file.  It will be in the base directory of your WordPress install.  

wp-config file

Look for the following line in this file:

define( 'WP_DEBUG', false );

And change it to this:

define( 'WP_DEBUG', true );

Now try reloading your site.  This won't fix the issue, but will at least give you an error message so you can see where the problem is.

It says style.css is missing

You've probably uploaded the wrong zip or a zip file containing your theme and a number of other files, like documentation or demo content.  Try unzipping this file first to make sure it's really your theme.  You should see a style.css file in here if it is.

 

Have more questions or run into any issues while updating?  Drop us a comment below!