How to Install and Activate Wordpress Themes on Your Blog (3 Methods)
Wordpress is the most popular content management system (CMS) powering more than 43% of the world’s websites. The main reason behind the popularity of this CMS is its ease of use, flexibility and its suitability for various needs. From a simple blog to an ecommerce store or even a portfolio site, you can build just around any type of website using Wordpress.
The CMS has a vast collection of themes, which can help you to build different kinds of websites including multi purpose themes that are just as suited for a blog as for an ecommerce store. These themes decide the look of your website and have a significant impact on your user experience. It is why one should carefully choose a theme based on various things like type of website, speed, security, SEO and other factors. However, you need not worry because the Wordpress theme repository includes some well coded themes that are just as fast as they are good in terms of SEO and customization.
After installing a theme, you can customize it to give it the desired look. While not all themes include extensive features for customizing the look of your blog or online store, some of them like Astra, Generatepress, Neve and so on are great for creating a very attractive looking blog or website. You also have some block based themes like Blocksy that work great with the Gutenberg editor and are fast as well as SEO optimized.
It is very easy to install a theme from the Wordpress repository. You will just need to select the right theme for your website and install it. However, there are more than one methods to install a theme in Wordpress. Most people do it from the dashboard, which appears to be the easiest method to install a theme. While you can directly install the free themes from the Wordpress theme repository, you will need to manually upload a premium theme before you can install and activate it. Here, we will discuss the various methods to upload and install a theme including wp-admin dashboard, SFTP using cyberduck or Filezilla and the slightly technical SSH method.
Install a free theme from Wordpress repository
To install a free Wordpress theme, you need to go to the appearance section in the wordpress dashboard from the left sidebar. Expand the appearance section and then click on themes. Here you will find the most popular themes on the front page. These are the themes that are the most popular among the Wordpress users. You can browse for more themes in the other sections including latest themes and block themes. Please select a responsive theme, which is lightweight and will load fast. There are plenty such themes including Generatepress, Neve, Astra and so on.
Once you have selected the theme that you want to use on your blog or Wordpress site, hover the mouse over the theme. You will now see the install and preview buttons appear. If you want to take a preview of the theme, you can click on preview and check out the demo theme. To install the theme, hover the mouse on the theme and then click the install button.
It will take just a few seconds for the theme to be installed on your blog. Now, go back to the themes section in appearance and then check out the theme you have freshly installed.
If you hover the cursor over the theme you just installed, two buttons will appear - activate and live preview. You can take a live preview to see how the new theme will look on your website before activating it for use. Once you have activated the theme, you can go to the front end and check if it is functioning properly. To further customize the theme, go back to Appearance -> customize and start customizing the theme and widgets for use.
It is recommended to take a live preview of a theme before activating it so that you can know what customizations are needed instantly and which widgets will have to be reinstalled.
Upload and install a theme via wp-dashboard or SFTP
You can only install the free themes or free versions of themes from the Wordpress repository. However, several times a free theme does not include all the features you need for your blog or Wordpress website. You might need extra features for your blog that are only available in the premium version or a premium theme. There are several themes in the Wordpress repository that come in both free and premium versions and you can buy a premium license to activate extra features.
However, there are also many themes including the ones by Studiopress (genesis themes) that cannot be downloaded from the Wordpress theme repository. So, if you are planning to have a Genesis theme on your website, you will need to buy it from Studiopress and upload it to your blog.
Premium themes or even the free themes are available as zip files. Suppose you bought a premium theme and want to upload it to your website. You can do it in two ways.
In the first method, you can upload the theme file from the Wordpress dashboard. Go to Appearance -> Themes and then click on add new at the top. This will again bring you to the Wordpress theme repository. However, instead of installing a theme from there, you have to click on ‘upload theme’ at the top. Now, click on choose file and select the zip file you have downloaded and upload it. When you upload a theme, it is installed automatically. The only thing you will need to do after uploading the theme is to activate it and then customize it to suit your needs. You can use the same method to update a premium theme where you need to directly upload the updated version.
In the second method, you can SFTP to your server and upload the theme file. First of all, download the theme file (available as zip file) to your computer. Now, use a SFTP client like Cyberduck to connect to your server. Click on open a new connection, enter the credentials and connect to your server. Now, go to the root folder or the folder where your Wordpress is installed. Go to Wp-content and then open the themes folder. Once inside the theme folder, upload the zip file you have downloaded to your computer. Right click on the zip file and then ‘expand archive’ to extract the theme. Now, you have uploaded your theme to your server using SFTP. If you go back to the wordpress dashboard -> Appearance -> Themes, you will find the new theme installed there. You can activate it to use it and then customize according to your needs.
Install and Activate a theme using WP-CLI
The WP-CLI or Wordpress Command Line Interface is a great tool for managing Wordpress. You can perform a vast number of tasks that you perform from the wordpress dashboard using the CLI as well. For example, whether you need to install a theme or plugin from the wordpress repository or update a theme or plugin, you can perform all these tasks from the WP-CLI.
To use WP-CLI, you must know how to run terminal commands and have the CLI installed on your server.
This process is slightly technical, requiring SSH access to your server. If you are already a WP-CLI user, then no problem, the commands to install and update themes are very simple. However, if you have not used the CLI previously, you can install it on your server and start using it.
Installing the CLI on your server is very simple and you will just require SSH access to do it. SSH to your server and then install the WP CLI by downloading wp-cli.phar using wget or curl. Run the following command, once you have connected to your server through SSH:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Now, make the file executable and move it to somewhere in your PATH.
chmod +x wp-cli.phar sudo mv wp-cli.phar /usr/local/bin/wp
To test if the wp-cli was installed successfully, you can try running wp–info. An output like the following shows that the wp-cli was installed successfully:
OS: Linux 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 Shell: /bin/bash PHP binary: /usr/bin/php8.2 PHP version: 8.2.8 php.ini used: /etc/php/8.2/cli/php.ini MySQL binary: /usr/bin/mysql MySQL version: mysql Ver 8.0.32 for Linux on x86_64 (MySQL Community Server - GPL) SQL modes: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli WP-CLI vendor dir: phar://wp-cli.phar/vendor WP_CLI phar path: /var/www/html WP-CLI packages dir: WP-CLI cache dir: /root/.wp-cli/cache WP-CLI global config: WP-CLI project config: WP-CLI version: 2.8.1
Once you have verified that the CLI is successfully installed, it is time to start running Wp-CLI commands. To run the CLI commands, you must first change to the root directory. Suppose your root directory is var/www/html.
You would first want to check the theme you want to install and its slug. To find out the theme you are looking for (like Astra), you must run wp theme search command:
Wp theme search astra
You will receive an output like the following:
Success: Showing 10 of 20 themes. +----------------------+----------------------+--------+ | name | slug | rating | +----------------------+----------------------+--------+ | Astra | astra | 98 | | Astralis Lite | astralis-lite | 0 | | Astral | astral | 98 | | Avantex Automobile | avantex-automobile | 0 | | Webenvo | webenvo | 0 | | Avantex Construction | avantex-construction | 0 | | Awp Marketing Agency | awp-marketing-agency | 0 | | Education Formula | education-formula | 0 | | Avantex | avantex | 100 | | Medical Formula | medical-formula | 0 | +----------------------+----------------------+--------+
The theme that we are looking for is right at the top. Now, we can install and activate this theme on our blog. You can install and activate the theme with the help of a single command:
Wp theme install astra --activate
The output looks like the following:
Installing Astra (4.3.0) Downloading installation package from https://downloads.wordpress.org/theme/astra.4.3.0.zip... Unpacking the package... Installing the theme... Theme installed successfully. Activating 'astra'... Success: Switched to 'Astra' theme. Success: Installed 1 of 1 themes.
You can see in the output that the Astra theme is installed and is now the active theme on your blog. Just go to your domain and check out. Switching to a different theme that you have installed on your blog is also easy. Suppose, you want to switch from Astra to Generatepress theme, you can easily do that with the help of the wp theme activate command:
wp theme activate generatepress Success: Switched to 'GeneratePress' theme.
So, this is how you can easily install, activate and switch themes in Wordpress using the WP-CLI.