When you are switching from one theme to another, then it’s better to delete the old theme if you no longer use it. When you install multiple themes in WordPress to test them, it occupies your webspace. In addition, there may be pre-installed themes on your website that you do not need anymore. You need to remove these unwanted themes from your website to tidy things up.
Removal of the themes or plugins increases the security as well as the load time of a website. In this article, we will discuss how to delete themes in WordPress.
When to delete a theme?
There may be certain conditions when you want to delete a WordPress theme.
- When you have installed a new theme and want to remove the old one.
- When you installed a theme for testing but found out that it does not work for you. If you want to test a theme, then you should use staging sites instead of LIVE websites. It helps to prevent unexpected site crashes.
- If you do not use the default theme, then you may want to remove it.
In any of these cases, the process of removal of themes is the same.
Why delete a WordPress theme?
There are a number of reasons to delete unused themes or plugins.
- The more the installed themes, the more the possibility of vulnerabilities.
- Though the theme is inactive, it needs a continuous update for security reasons. If it is deleted, you no longer need an update.
- The number of inactive themes increases the backup sizes and it takes longer to complete a scan with a security plugin. As it increases the space, you may need a bigger hosting plan.
- The data of the inactive theme will be stored in the database in case you need to reactivate again. However, when you delete the theme, the associated data will be removed.
- WordPress will query every theme installed and recommend for updates though you may not need an update of unused product. This increases time as well as performance will be affected to some extent.
When not to delete themes in WordPress?
There are some conditions when the theme is not active but you should not delete it.
- If the theme is the parent theme of the currently active child theme.
- If the theme is active on any site on the Multisite network.
- When you may need the theme for testing or to reactivate later.
Deleting Vs. Uninstalling Theme
You cannot activate two themes on a site. If you activate any theme, then the current theme gets deactivated by default. While in the case of plugins, we have to manually deactivate each plugin but it is automatic in theme. As a fact, there can be only a single active theme in a site.
The settings of the old theme are kept in the system for future reference. In case you activate it again then the configured settings will be used from the database. Actually, it saves time. The widgets of the old theme are saved and moved to the Inactive Widgets section. However, you need to specify the location for the old menus.
If you no longer use a theme, then you can delete a theme to permanently remove a theme and its settings.
Is it safe to delete WordPress Themes?
Firstly, be sure that you are not using that theme, neither at present nor any time later. WordPress needs an installed theme to display the website and function properly. If you go to Appearance > Themes in your admin dashboard, you can check your active theme.
It is recommended to keep at least one default theme provided by WordPress. Just in case your current theme stops working, it will act as a fallback.
In addition, you need to keep the parent theme if you are using the child theme.
If you have followed all the procedures mentioned in this section, then you can safely delete other themes, if present.
Before you delete a WordPress Theme
You should create a backup to save the customizations of the WordPress theme. As a backup, you can locate and download the theme folder to your computer. File manager app or FTP Client can be utilized to do this. The location public_html/wp-content/themes contain the active as well as inactive themes of the site. A safe backup of an old theme is a must before you proceed to delete it.
In addition, you can test the deletion on a staging site. To do this, you need to copy your site to the staging site. Delete the theme from the staging site to make sure that the theme deletion will not break anything.
Furthermore, perform a check to ensure whether or not the theme is connected to any child themes or multisite networks.
How to Delete Themes in WordPress
You can delete themes from WordPress in multiple ways. Let’s have a look at it:
Deleting a WordPress Theme via. Admin Dashboard
This is the recommended method if you have access to the admin dashboard. Go to Appearance > Themes. You will see the list of installed themes where the active theme appears in the front. Click any inactive theme to view the details. There are Activate, Live preview buttons on the next page. In the lower right corner, there is a delete link. WordPress will confirm by asking you again, Click Ok to confirm the deletion of the theme.
Deleting a WordPress Theme via. FTP/SFTP
When you do not have access to the admin dashboard but have access to the site via. FTP/SFTP, you can delete the folder where the theme is located. Navigate to wp-content/ themes folder. You will see all the installed themes in a separate folder.
However, you cannot know whether the theme is active or inactive from this method. Sometimes, you may be unable to access the admin dashboard due to a broken theme then this is the solution to you. Select the theme folder which you want to delete. Click delete and proceed through the confirmation to delete it.
Delete a WordPress Theme via. File Manager
If you have access to the web hosting control panel, you can proceed with this method. The hosting dashboard depends on the hosting provider. Open the File Manager from your hosting dashboard. Locate the public_html/wp-content/themes folder just like the previous method. Select and delete the theme that you no longer use.
Delete a WordPress Theme via. WP-CLI
This is the last option to delete your theme. Unlike previous methods, this may cause an error and delete the wrong files if you are not careful.
Start the command line using WP-CLI
If you want to see a complete list of installed themes, type this code:
You can also check inactive themes with the help of this code below:
Make sure this list does not include the parent theme of your installed theme(if you are running a child theme). In addition, you have to be sure that it is not active in any multisite network.
Finally, to delete the theme, enter this code:
The final parameter is the folder name where the theme is located. Don’t get messed up by writing the theme name.
The confirmation of theme deletion will appear shortly.
This is one of the fastest ways to delete the theme but it carries a risk to those who aren’t familiar with WP-CLI. So, always be safe with a backup.
There may be contents related to the theme which you no longer need. These contents can be:
Widgets
The widgets of the deactivated theme get moved to the Inactive Widgets area in the Widgets screen. You can keep these widgets in the new theme or remove them if you do not need them. Not only you can remove them individually but also they can be removed at once with Clear inactive widgets button.
Menu
The menu of the old theme will be available in the new theme. However, the location for each menu should be specified. There are conditions when you use multiple menu locations in an old theme but not supported by a new theme. In such a case, Custom Menu widget can be used to add a menu to a sidebar or footer widget area.
Images
To be compatible with the layout of the theme, there are featured images with different image settings. There may be multiple images in your old theme that were used in slider or carousel. If you delete WordPress themes, then you should manage these images as well.
Images can be resized to match the new theme settings. There are plugins available in the official WordPress repository to do this. If you do not need an image, instead of resizing you can permanently delete it. The speed of the site depends on the image size, compression, etc. so this must not be neglected.
Dummy Content
Dummy Contents are used to test whether or not the theme is working. If you have done the same, you should remove those from your site.
When you delete the theme, the posts and pages can also be removed. If you still need them, you may leave them where they are.
In addition, the post associated with custom post type should be deleted before the theme is removed. This is because once the theme is gone, you can no longer see the properties associated with that post type.
How to recover if you accidentally delete a WordPress theme?
Accidentally, if you delete a parent theme of an active child theme, you will have to face and fix the CSS errors of the site. Unknowingly, if you deleted active theme, then WordPress will make another theme active(provided that you have another installed theme).
Don’t worry. There are multiple ways to restore it.
Firstly, you can restore your site from the backup. As we mentioned multiple times, do not delete a theme unless you have a backup copy. In WordPress, you get back up plugins to restore your site to an earlier state.
Secondly, if you failed to store a backup copy, then you can download and install a fresh copy of the same theme. However, the customizations made will be lost and you need to do that again.
Be sure to test your site after you delete the theme. Open your site after clearing the browser cache. Make sure that the website is performing well without errors.
Wrapping Up
Hopefully, you learned to delete themes from WordPress. There are a lot of traces left after you delete the theme.
You need to clear those things. Firstly, you need to ensure that your backup is safe before performing this action. Accidentally, if anything goes wrong you have to be on a safer side.
Furthermore, we would like to request you to read this article twice before you start deleting your unused themes. You already know where to come for further questions.
Additional Readings
It was helpful. Keep on posting!