How to Delete Theme in WordPress

Managing themes effectively is a key aspect of maintaining a WordPress website, ensuring it remains clean, fast, and secure. Knowing how to delete theme in WordPress is crucial, especially when themes are no longer in use or have become outdated. Deleting unused themes can enhance your site’s security, improve its speed, and simplify the user interface by removing clutter. This guide will walk you through the process, step by step, to ensure that you can manage your site’s themes efficiently and safely.

FAQ

Why can't I delete themes on WordPress?

You may not be able to delete a theme if it is currently active on your site. To delete a theme, you must first activate a different theme. Additionally, ensure you have the necessary user permissions to manage themes.

What happens if I delete a WordPress theme?

Deleting a WordPress theme removes all its files from your server, which means you can no longer use that theme unless you reinstall it. Any customizations made directly within the theme’s files will be lost. However, posts, pages, and content created within WordPress will not be affected.

How do I delete a custom template in WordPress?

To delete a custom template, access your site via FTP or the File Manager provided by your hosting service, navigate to the `/wp-content/themes/your-theme/` directory, find the template file you want to delete (typically a `.php` file), and delete it. Always ensure you have backups before deleting any files.

How do I delete theme data?

To delete theme data, which includes settings and options specific to a theme, you’ll typically need to use a plugin designed for cleaning up leftover data, or you may need to manually remove data from the WordPress database, particularly from the `wp_options` table. Be cautious and back up your database before making direct changes.

Why delete a WordPress theme?

Before diving into how to delete theme in WordPress, it’s important to recognize the benefits that removing a theme can offer your site. 

Enhance security

One of the primary reasons to remove unused themes is to enhance your website’s security. Themes that are not actively used or regularly updated can become vulnerabilities. Hackers often exploit outdated themes to carry out malicious attacks. By removing these unused themes, you minimize the risk of security breaches, keeping your site safer.

Improve site performance

Although the impact might be minimal, having multiple themes installed can clutter your WordPress installation and potentially slow down your site. Each theme adds to the load on your server, albeit slightly, but streamlining your themes can contribute to overall site performance. In performance optimization, even small gains are valuable, particularly for larger sites.

Reduce maintenance overhead

Every theme installed on your WordPress site potentially requires updates and maintenance to ensure it remains compatible with the latest WordPress core updates and secure from vulnerabilities. By deleting themes that you no longer use, you reduce the maintenance overhead, making it easier to manage and update your site.

Save disk space

Themes, particularly those rich in multimedia elements, can consume a considerable amount of disk space. Removing these can free up valuable server space, which is especially beneficial if you are operating within the disk space limitations of your hosting plan.

Simplify the user experience

Maintaining only the necessary themes in your WordPress installation simplifies the backend, making it more user-friendly. This is particularly helpful for new users or non-technical administrators, as it reduces confusion about which theme is active or needs editing.

Compliance and cleanliness

For those managing WordPress sites under strict company policies or who aim for optimal site management, removing unused themes helps comply with these policies and maintains a clean site setup. This practice ensures that only relevant, up-to-date themes are available, simplifying management and reducing clutter.

Deleting vs uninstalling a WordPress theme

The difference between deleting and uninstalling a WordPress theme primarily centers on the extent of removal, particularly regarding file deletion versus comprehensive cleanup including database entries.

Deleting a WordPress theme

The theme’s files are removed from your server; however, some residual data such as settings and options may remain in the WordPress database. These remnants generally do not affect performance but could clutter your database over time.

Uninstalling a WordPress theme

Uninstalling ideally involves not only removing the theme files but also cleaning up all associated data from the database, including settings and customizations made within the theme. WordPress does not inherently differentiate between deleting and uninstalling in terms of database cleanup. True uninstallation might require additional steps or plugins specifically designed to purge all traces of the theme from the database.

When to prefer uninstalling over deleting

If you are changing themes and want to ensure that no leftover settings interfere with your new setup, uninstalling is preferable. This is particularly relevant when switching from a theme that heavily modifies WordPress functionality, such as those with built-in custom post types or complex configurations.

In situations where a theme might have been causing performance issues or has known security vulnerabilities, a full uninstallation (including database cleanup) ensures that all potential problems are removed.

For websites that have cycled through many themes, cleaning up old theme data can help optimize database performance and reduce its size, which is beneficial for site speed and efficiency.

Preparation before deletion

Before understanding how to delete theme in WordPress, it’s crucial to prepare properly to avoid potential issues that could affect your site’s functionality and data integrity. Here are the key steps to take:

Backup your WordPress site

Always ensure that you have a recent backup of your entire WordPress site, including the database and all files. This provides a safety net that allows you to restore your site to its previous state in case something goes wrong during the theme deletion process.

How to backup 

You can use various methods to backup your WordPress site:

  • Plugins: Use plugins like UpdraftPlus, BackupBuddy, or VaultPress for automated and scheduled backups.
  • Hosting tools: Many hosting providers like 10Web offer site backup tools that can be configured to run regularly. 
  • Manual backup: You can manually backup your site by downloading a copy of your files via FTP and exporting your WordPress database through phpMyAdmin.

Ensure the theme is not active

Make sure the theme you intend to delete is not currently active on your site. Deleting an active theme could cause your site to display improperly or result in errors.

Switching themes

  • Navigate to your WordPress dashboard and go to Appearance > Themes.
  • You’ll see your currently active theme highlighted at the top. Before deleting a theme, you must activate a different one.
  • Choose another theme from the list and click Activate. Ideally, activate a default WordPress theme like Twenty Twenty-One or Twenty Twenty-Two, as these are stable and less likely to cause issues.

Additional considerations

If the theme you’re deleting has a child theme or significant customizations, ensure that these are either backed up or migrated to a new theme if needed.

Some themes have unique settings and customizations that you might want to replicate in a new theme. Document these settings or take screenshots before deleting the theme.

How to delete theme in WordPress 

Deleting unused themes from your WordPress site is a crucial step in maintaining its performance and security. Here is a step-by-step guide on how to delete theme in WordPress, exploring three common methods: via the WordPress Dashboard, using FTP/SFTP, and via WP-CLI. Each method is suited to different levels of user expertise and access preferences.

Method 1: Via WordPress dashboard

The most straightforward method of how to remove theme from WordPress for most users is through the WordPress admin dashboard. Here’s how to delete a theme in WordPress using this approach:

  1. Log in to your WordPress Dashboard.
  2. Navigate to Appearance > Themes to view all themes currently installed on your WordPress site.
  3. Find the theme to delete. Hover over the theme you wish to remove and click the Theme Details button.
    how to delete theme in wordpress
  4. Located in the bottom right corner of the theme details window, click the Delete button.
  5. A prompt will appear asking for confirmation to delete the theme. Confirm this to proceed. Ensure that the theme is not active on any site or network sites, particularly if using a WordPress Multisite installation.

how to delete theme in wordpress

Method 2: Using FTP/SFTP

For those who prefer manual control or cannot access the WordPress dashboard, FTP/SFTP serves as a reliable alternative:

  1. Connect to Your Website via FTP/SFTP. Use an FTP client like FileZilla and connect using credentials from your hosting provider. Read the guide of how you can do it here.
  2. Go to `/wp-content/themes/`, where all installed themes are stored.
  3. Search for and find the directory of the theme you want to delete.
  4. Right-click the folder and choose Delete or Remove from the context menu. Confirm the deletion to remove all associated files from your server.

how to delete theme in wordpress

how to delete theme in wordpress

Method 3: Using WP-CLI

WP-CLI is an efficient command-line tool ideal for developers or administrators who manage WordPress sites via the command line:

    1. Connect to your server via SSH. Access your server where the WordPress site is hosted.
    2. Navigate to your WordPress Root Directory. This should be the installation directory of your WordPress.
    3. List installed themes (optional). Run `wp theme list` to display all installed themes.
      wp theme list 

    4. Delete the theme. Execute the deletion with `wp theme delete theme-slug`, replacing `theme-slug` with the actual slug of the theme.
      wp theme delete theme-slug

      For instance, to delete the Twenty Twenty-One theme, you would use `wp theme delete twentytwentyone`.

Common issues and troubleshooting

Now you know how to delete theme in WordPress. However, when trying to remove theme in WordPress, you might encounter issues such as the absence of a default theme or accidentally deleting the wrong theme. Here’s how to troubleshoot and resolve these common problems:

If the default theme is absent

Sometimes, a WordPress site may malfunction if it lacks a default theme (such as one of the “Twenty” series themes) to fall back on. This situation can occur if the current theme is removed or corrupted without an appropriate default theme available.

Here’s how to resolve it by manually installing a default theme:

  1. Download a default WordPress theme from the WordPress Theme Directory. 
  2. Choose a stable release like Twenty Twenty-One or Twenty Twenty-Two.
  3. Access your site via FTP or your hosting provider’s file manager.
  4. Navigate to the `/wp-content/themes/` directory.
  5. Upload and extract the downloaded theme zip file into this directory.
  6. Log into your WordPress dashboard and navigate to Appearance > Themes to activate the newly uploaded default theme.

Alternatively, if you have WP-CLI installed, you can quickly install and activate a default theme using the command line. Run the following commands:

wp theme install twentytwentytwo --activate

This command installs and activates the Twenty Twenty-Two theme directly.

Accidentally deleting the wrong theme

Now we know how to remove theme from WordPress, but we can run into the issue of removing the wrong theme. Deleting the wrong theme can be distressing, especially if it contained custom modifications or was actively in use.

If you have a backup available, the easiest way to restore a deleted theme is by restoring that backup. Use whichever tool or plugin you utilized for the backup (such as UpdraftPlus, BackupBuddy, or your hosting provider’s restoration feature).

If you don’t have individual file backups but the theme was downloaded or purchased from a third-party, re-download and reinstall the theme from the source. Upload the theme via WordPress dashboard under Appearance > Themes > Add New > Upload Theme or via FTP to the `/wp-content/themes/` directory.

General troubleshooting tips

  • Ensure compatibility: Always make sure that the themes you are using are compatible with your version of WordPress to avoid functionality issues.
  • Keep regular backups: Regular backups are your safety net. Make sure to schedule them frequently and before making significant changes like theme deletions or updates.
  • Check file permissions: Incorrect file permissions in the `wp-content/themes` directory may cause issues with theme installations and operations. Ensure permissions are correctly set (usually, folders 755 and files 644).

Conclusion

This guide has detailed three methods of how to delete theme in WordPress: via the WordPress Dashboard for ease of use, using FTP/SFTP for manual control, and WP-CLI for those who prefer command-line operations. Each approach offers specific advantages depending on your needs and access level.

Before removing any themes, always ensure to back up your website to prevent data loss. Additionally, it’s wise to keep at least one default WordPress theme installed as a fallback to avoid potential disruptions. This preparation ensures your site remains secure, efficient, and operational even after deleting themes.

Simplify WordPress with 10Web
Share article

Leave a comment

Your email address will not be published. Required fields are marked *

Your email address will never be published or shared. Required fields are marked *

Comment*

Name *