Tutorial

How to Update a Theme in WordPress

Keep the active theme updated and delete unused themes to increase the security of your WordPress website.

Why update themes?

WordPress themes are like any other piece of software. Developers frequently release updates to add new features and fix known bugs. You may not need the latest features of a theme, but it is important to update it so you are sure your website is running the most stable and secure version of the theme.

Warning

Back up your website before updating themes. Also, consult the release notes of the new version before updating a theme. This will help you to identify problems that may happen if the theme is updated.

One-click update

Go to Appearance in the WordPress admin bar. If a new version is available for a theme, WordPress displays a message and you only need to click Update now.

Link to update a theme using the one-click method.

Automatic update

This is the easiest method to update themes in WordPress. It is based on the auto_update_theme filter. Add the following code and WordPress will update each theme once a new version is available.

// Enable automatic updates for all themes
add_filter('auto_update_theme', '__return_true');

Use this method with caution. One day something may be going wrong on your website and after spending precious time, you discover that the problem happens because the active theme was updated automatically, but the new version is incompatible with plugins, custom CSS rules, etc.

Manual update

This method is rarely used as it is more complicated than other methods.

Step 1: Put your website in maintenance mode.

Step 2: Use FTP or cPanel and navigate to the themes folder of WordPress. This folder is normally at wp-content/themes inside the WordPress root directory.

Step 3: Identify the theme files. Each theme has a corresponding directory in the themes folder.

Step 4: Replace the theme files with the files of the new version.

Step 5: Put your website out of maintenance mode and check that everything is working properly.

Further reading

I recommend the other tutorials in this series to learn more about managing themes in WordPress.

Source code

The source code developed in this tutorial is available here.

WordPress

Related Tutorials

Open chat
Need help?
Hi! 🤝 Open the chat if you have any question, feedback, or business proposal. I would love to hear from you.