How to Delete WordPress Themes And When to Do It

How to Delete WordPress Themes And When to Do It

There are a few situations that require the deletion of WordPress themes. You might want to change your WordPress theme. Another situation is that WordPress comes preinstalled with some themes. If you have themes that are not in use it is best to remove them.

Removing unused themes is advisable because it will make the site faster and enhance security.

In this article created by our team at wpDataTables, four methods are discussed for deleting old or unused WordPress templates. Following these procedures ensures their safe and thorough deletion.

Why Delete Unused WordPress Themes

WordPress comes with predefined website templates. These themes are used for modifying a website’s appearance, without the need for writing the program code.

Some may reason that if they keep those templates, they might come in handy in the future.

However, it is better to remove your unused theme and plugin code from the WordPress installation.Here are the reasons why it is best to clean up unused themes and plugins:

  • WordPress theme files can be hiding places for malicious code or malware. A WordPress site can become compromised because these files are written in PHP. Hackers can target unused themes to leave malignant code.

  • The backend of a WordPress site can be affected by inactive themes because of updates. Every time an update becomes available, the admin dashboard will be checked for themes to which the update can be applied. Updates are applied to both active and inactive themes.
  • Every file on your hosting plan takes up space. This leads to performance issues, such as the slowing down of the website. Saving space may also save you money as a more expensive plan may not be necessary.

  • All information on the server is backed up. Backup sizes and times increase linearly. Also, the WordPress security plugin will require additional scanning time.
  • Additional information on inactive themes is stored in the database in case the theme is applied again. Deleting the theme will remove this information from the database resulting in enhanced database performance.

When Not to Delete a WordPress Theme

In general, deleting redundant WordPress templates is good practice. However, sometimes it is not advisable to delete them, such as:

  • Some themes are not in use but are connected with others. The deletion of these inactive themes will affect the active one.
  • If themes are not being used temporarily, it is best not to delete them, so they can be used again.
  • In the case when a multisite network is used. Possibly, the theme is used on different parts of the network.

If none of the above applies, it is best to remove the unused WordPress themes.

Uninstalling or Deleting

A WordPress site requires at least one active theme. Besides this one theme in use, many themes can be installed. Not all of the installed themes are necessarily used.

Though a theme is not actively applied, it is still installed on the site. They take up space and require updates.

Not only the theme file is saved on the server, but also the associated settings, widgets, and menus.

The advantage is that if the theme is reapplied, all associated information is immediately available. Yet, WordPress does not guarantee the retention of this information.

When a theme is deleted all associated files, settings, widgets, and menus are removed with it.

Deleting a theme is the option if the related information is no longer needed and one is sure that that it will not cause any issues to active themes.

How to Delete a Theme

These are the four ways in which a WordPress theme is deleted.

Through the WordPress Dashboard

First, open the WordPress dashboard and then Appearance, and Themes.

Active themes can not be removed. If the active theme is the one to be removed, then the default WordPress theme must first be enabled.

Select the inactive theme to see the details. Then click the Delete button, which is located at the bottom right. The theme is now deleted.

Next, click the deactivated Cherry Framework to display the details, then click Delete. Now also the Cherry Framework is deleted successfully.

Via FTP/SFTP

Themes can be easily deleted through the site’s FTP/SFTP. This approach can be used if access to the WordPress site is not available. FTP information can be obtained through the web host.

Deleting active themes will cause problems. So be sure that the themes to be deleted are not active or first enable the default theme.

Connect to the website’s FTP/SFTP and go to the WordPress installed themes folder. This is found in wp-content/themes. In this folder, all installed themes are found.

In most FTP clients, you can right-click and delete the inactive themes.

Using File Manager

For some using the File Manager app in the web hosting control panel is easier than using an FTP client.

The procedure is simple. Login to the hosting account dashboard and go to the File Manager. In the File Manager go to the Advanced tab.

This opens a file manager, much like the browser for an FTP client. Navigate to /public_html/wp-content/themes/ folder.

In this folder right-click on the inactive theme and delete.

Via WP-CLI

A fourth way is by using WP-CLI. This is probably the quickest option but requires familiarity with utilizing the command line for managing a site. Using WP-CLI calls for some experience. Consequences will come with a mistake made at this point

Access the site using WP-CLI. A list of all the installed themes is visualized by typing:

$ wp theme list

This list is narrowed down to the inactive ones by using the following command:

$ wp theme list --status=inactive

This list will show the themes that probably can be deleted without any problem. Remember that some of these themes may be associated with another theme and should not be deleted. If a multisite network is used, you need to make sure that the theme is not being used on another site in the network.

The following command deletes a theme:

$ wp theme delete twentyseventeen

The final parameter is the theme’s folder. It is not the name of the theme.

After pressing enter a message is displayed, advising that the theme was deleted:

Deleted ‘twentyseventeen’ theme.

Success: Deleted 1 of 1 themes.

For experts in WP-CLI, this is the fastest method. It is easier to make mistakes because the command line is less visual and does not show any information about the theme. Take care when using this approach. Test on a staging site first and have a backup.

Ending thoughts on how and when to delete WordPress themes

Deleting unused themes helps to clear server space and to keep the website secure. Knowing how to do this is an essential skill in caring for a website.

This is just one of the things that should be done as part of WordPress’s performance and security maintenance.

If access is available, using the WordPress Admin Dashboard is the easiest method. Using the Dashboard rather than an  FTP server shows which themes are active and which ones are not.

If you enjoyed reading this article about how to delete WordPress themes, you should read these as well:

Up Next:

How to Set Up WooCommerce Test Mode Easily For Your Shop

How to Set Up WooCommerce Test Mode Easily For Your Shop