Managing WordPress themesIn this article, you can find the following information about WordPress themes:
What is a WordPress theme?Themes in WordPress were originally only used for changing the design (layout) of a website. Nowadays, there are a lot of themes that are very complex and totally change the way a WordPress installation functions. For example, some themes come with their own website builders that allow you to edit the website content very easily, others overhaul the default WordPress back and front-end. How to choose a WordPress theme?There are thousands of free themes available for preview and activation directly in the WordPress Dashboard. These themes can also be downloaded from the WordPress theme repository. Of course, this includes the default WordPress themes (like TT1 Blocks, Twenty Twenty-Three, Twenty Twenty-Two, Twenty Twenty-One, Twenty Twenty, etc.). Commercial themes can be found in the WordPress repository or dedicated theme-selling websites. Some commercial themes are available for purchase and download only through the websites of their vendors. There are basically themes available for all tastes. Of course, if you need something that is not available yet, there is always the option to hire a theme developer to build you the exact theme that you want and need. When choosing a theme for your WordPress website, you should also consider checking if the theme receives regular updates, and if its developers, support team, or community offer any assistance. Regular updates are important as they will help prevent or fix potential compatibility issues with the theme and future versions of the WordPress core or plugins. If you run into any issues related to the theme, the chances of getting the issues resolved will increase significantly if the theme developers can help or there are active and knowledgeable members in the theme's community. You can also refer to the official WordPress community for assistance, but they may not be always able to help. How to install a WordPress theme?After you have found the theme that you wish to use, there are several ways to actually install it on your WordPress website - via the WordPress Dashboard, with the help of the WordPress command-line interface - WP-CLI, or by manually uploading it to the account. Installed themes can be activated via the WordPress Dashboard, as well as via WP-CLI. Some themes may require additional steps for their proper installation or activation (adding files, installing plugins, or purchasing a license for example), so please refer to the official instructions of the theme that you wish to use on your website. You can install and test new themes on existing WordPress websites risk-free by using a staging instance. More information on how to set up a staging instance of your existing WordPress website via the hosting Control Panel is available in our Creating and using WordPress staging sites article. Installing and activating a WordPress theme via the DashboardInstalling a new theme via the WordPress Dashboard is the easiest and most user-friendly method which requires just a few steps. You only need to log in to your WordPress Dashboard (you can access it by adding "/wp-admin" to your website's URL - for example, http://your_domain.com/wp-admin) or even easier, use the "Log in" feature available in the hosting Control Panel > WordPress Manager as explained in our Managing WordPress administrators article. Once logged in, navigate to the Appearance > Themes section. If your new theme is available in the WordPress theme repository, you can search for the theme directly through the WordPress Dashboard and use the Install button when you hover over its block. Your new WordPress theme should now be installed successfully, and all that is left is to activate it by simply clicking on the Activate button: Installing and activating a WordPress theme with WP-CLIWP-CLI is supported on our servers, and you can use it with all hosting accounts. It basically allows you to use a command-line interface to manage your WordPress websites. For more information about WP-CLI, you can check our WP-CLI Tutorial article. To install and activate a new theme via WP-CLI, you need to follow these steps:
Installing a WordPress theme by uploading it to your account and activating itThis method is the least preferred as different actions have to be performed and that is why it is usually the slowest. To start, you need to:
How to update a WordPress theme?Updating your active WordPress theme may cause your website to malfunction or even fully crash. For this reason, it is very important that you check your website thoroughly after a theme update and always have a working recent backup of your WordPress installation. Although our automatic backups are generated twice per day and kept for seven days, we strongly recommend that you create a full backup of your WordPress installation right before updating your theme. This way you will have a restore point generated moments before the update, so you will be able to restore the website without any loss of data or information in the event of a problem. You can create backups of your WordPress websites with just a single click via the hosting Control Panel > WordPress Manager as explained in our Creating, downloading, and restoring from WordPress backups article. Some themes may support automatic updates or updates through the WordPress Dashboard which allows for quick and easy updates. Other themes may require manual actions like downloading the latest version of the theme from the vendor, changing custom settings, or uploading the theme manually to your account. In the latter case, you should refer to the official documentation of your theme for instructions on how to update it correctly. Utilizing automatic theme updatesThere are WordPress themes that support automatic updates. Automatic updates for themes are disabled by default. You can enable them in one of two ways - the WordPress Dashboard or via WP-CLI. Automatic updates are processed twice per day by default, and you will see how much time is left before the automatic update will be processed for a theme next to it in the WordPress Dashboard > Updates section. After a theme has been updated automatically, an email message will be sent to the website owners about the event. To enable automatic updates for a theme via the WordPress Dashboard, you need to:
You should follow these steps to enable automatic updates for a WordPress theme via WP-CLI:
Updating a theme through the WordPress DashboardThemes can be updated through the WordPress Dashboard after logging in as an administrator and going to the Updates section:
Alternatively, you can update a theme from the Appearance > Themes section of the WordPress Dashboard by clicking on the Update now link from the New version available notice of the theme with an available update: Updating a theme with WP-CLIUpdating a theme with WP-CLI is very quick. All you need to do is:
Updating a theme via the File Manager or FTPThe process of updating a theme via the File Manager or FTP requires that you replace the directory (and files) of the outdated version of the theme with the directory (and files) of the latest version of the theme. So, the process is almost the same as installing a new theme, which is covered in the Installing a WordPress theme by uploading it to your account and activating it section of this article. The only difference is that you will need to choose whether you wish to remove the contents of the outdated theme from the account, or upload the latest version of the theme and overwrite any existing files. How to disable a WordPress theme?To disable a WordPress theme, you simply have to set another theme as active for your website. More instructions on the process of installing and activating a theme are available in the How to install a WordPress theme? section of this article. Note: We recommend that you delete any themes which you do not plan to use as third parties may be able to exploit vulnerabilities of both enabled and disabled themes and plugins. How to delete a WordPress theme?If you need to delete a theme from your WordPress website, this can be achieved in one of three ways: through the WordPress Dashboard, using WP-CLI, or by deleting the theme's folder from your account. In general, you should not have more than two themes (three if you use a child theme) installed on the account at all times. Your main (and child) theme, and one default WordPress theme that will be used as a fallback option in case of issues with your main (and child) theme. Deleting a theme through the WordPress DashboardTo delete a theme with the WordPress Dashboard, you need to log in as an administrator to your WordPress website. After that, you should navigate to the Appearance > Themes section and click on the block of the theme that you wish to delete: Click on the Delete button that will be visible in the box showing details about the theme:
Note: The active theme of a WordPress website cannot be deleted via the Dashboard. Deleting a theme using WP-CLIThe deletion of themes takes just four steps when using WP-CLI:
Note: WP-CLI can be used with the --force option to delete themes that cannot be deleted by default or for some other reason. Please use this option with care as you may potentially break your website with it. Deleting a theme via the File Manager or FTPImportant: This method should be used only if you are very familiar with the WordPress directory/file structure. With this method, you can delete your active (or parent) theme which will result in downtime of your website. If you still wish to give this method a try, we recommend that you create a WordPress backup of your website beforehand via the hosting Control Panel > WordPress Manager as explained our Creating, downloading, and restoring from WordPress backups article. To delete a theme via the hosting Control Panel > File Manager section or FTP, you have to delete the theme's directory from the /wp-content/themes directory of your WordPress website in the account. If WordPress is installed on the main domain of your account, you will find your themes in the ~/www/www/wp-content/themes directory. Navigate to that directory using the File Manager section or your FTP program, and delete the directory. Details on how to connect to your account via FTP are available in the Uploading files section of our online documentation. How to use a child theme in WordPress?A child theme in WordPress is essentially your own version of another (parent) theme. You can define and use custom elements like stylesheets, functions, and scripts in your child theme, but at the same time, the child theme will inherit the parent theme's look, feel, and functionality. The best thing about using a child theme is that all of its custom elements will remain intact if the parent theme is updated. If you were to make changes to the files of the parent (original) theme, they would be lost upon update. Depending on the (parent) theme that you are using on your WordPress website, you should refer to its documentation for instructions on configuring a child theme. By default, you can create a new child theme by simply creating a new directory for it using the hosting Control Panel > File Manager section or an FTP client. The recommended naming pattern for child themes is to have the slug/directory name of the parent theme (e.g. twentytwentythree) appended with the "-child" string (e.g. twentytwentythree-child). You should create the directory in the /wp-content/themes directory of your WordPress website in the account, so for a WordPress installation on the main domain of your account, you should create the directory at ~/www/www/wp-content/themes. For the child theme to work correctly and be recognized by WordPress, you need to create a styles.css file in its directory (e.g. ~/www/www/wp-content/themes/twentytwentythree-child/styles.css) with the following content: /* After you are ready with the changes to your child theme, you have to activate it via the WordPress Dashboard or via WP-CLI. How to secure a WordPress theme?Free and commercial WordPress themes are generally secure. In case any vulnerability is found for a theme and reported in the WordPress community, the developers of the theme are informed, and it is up to them to release a new version of the theme where the vulnerability has been fixed. Commercial themes are usually less likely to get affected by such issues or exploits as their source code is not publicly available; however, that is not always the case. When it comes to the security of a WordPress theme, be it free or commercial, there are two major factors: 1. Obtaining your WordPress theme from a legitimate sourceYou should always obtain WordPress themes from official vendors or reputable sources. If you are interested in using a free theme on your WordPress website, you should obtain it from the WordPress theme repository. Commercial themes should be purchased and downloaded ONLY from their vendor or official resellers. There are many leaked or pirated versions of both free and commercial themes; however, they often come at a high cost - malware or malicious code injected in the core files of the theme. Of course, this allows the bad actors to access all your website data (including all files of your hosting account) and use your account to perform malicious activities (like attacking third-party websites or networks and sending spam messages). 2. Updating and maintaining your WordPress themes regularlyThe best way to keep your WordPress installation and themes protected is to perform updates regularly. Newer versions usually offer security, stability, and performance improvements as well as new features. You can find how to update your themes in the How to update a WordPress theme? section of this article. In general, you should have just one or two themes installed on the website. If you are using a default WordPress theme, you should keep only this theme installed on your website and remove all other themes. In case you use a non-default WordPress theme, you should keep the non-default and one default WordPress theme installed on your website. Having a default WordPress theme installed is recommended as it will be used as a fallback option if a major problem occurs with your active theme. |