WordPress is the world's most popular website builder, with more than 43% of the web being built on WordPress. While this makes it an obvious choice for building a new website, it also means that WordPress sites are a prime target when it comes to hacks.
The majority of WordPress websites that get hacked are due to an outdated WordPress core, plugins, or theme. Updates fix bugs and security vulnerabilities, and often add new features. With that in mind, it is highly recommended to always keep all aspects of your WordPress site up to date.
Here we detail the steps to update a WordPress theme to the newest version either within the WordPress dashboard or via command line using WP-CLI.
Related Articles
Update WordPress Plugin
Update WordPress Version
Add a WordPress Theme
Log into WordPress Dashboard
Full and Partial Backups in cPanel
Enable/Disable Automatic Updates in WordPress
Find the Document Root of a Domain
Update Theme from Dashboard
CAUTION: Updating WordPress can cause unexpected behavior or loss of functionality on your site. It is highly recommended to create a backup before proceeding with any updates.
- Log into the WordPress dashboard
- Navigate to Dashboard -> Updates
- Under the Themes section, click the checkbox next to the theme(s) you wish to update, then click the Update Themes button
NOTE: Any customizations you have made to theme files will be lost. Please consider using child themes for modifications.
Update Theme using WP-CLI
- Access the server via SSH or using the Terminal in cPanel
- Navigate to the site's document root using the cd command
cd public_html
REPLACE: public_html with your domain's document root if different. See the guide on finding the document root of a domain for guidance. - List the currently installed themes by running the following command
wp theme list
- If the update column says "available", you can update that theme by running the following command
wp theme update theme_name
REPLACE: "theme_name" with the theme slug from the name column in the theme list. For example:
wp theme update twentytwenty
TIP: Use the --all flag to update all themes at once.wp theme update --all
- Repeat step 3 to confirm the theme has updated successfully
Comments
0 comments
Article is closed for comments.