Site icon Hip-Hop Website Design and Development

How to Delete a Theme in Cheap WordPress

It’s a good practice to remove unused themes so that you don’t have to maintain them with updates for security purposes.

If a theme is installed on your site, it means all the files still exist on your server. That means the code could still be exploited, even if the theme isn’t active. So you either have to maintain the updates for the theme, or you should just remove it.

Your site should have 2 or 3 themes.

  1. Your active theme
  2. If your active theme is a child theme, the parent theme must also be installed
  3. A default WordPress theme – (Twenty something) as a fallback

Any other themes are unnecessary and can be removed.

Find out what the active theme is

How to delete a theme from your WordPress admin

It’s easy to delete a theme from your WordPress site.

How to delete a WordPress theme from cPanel or via FTP

Can’t delete your WordPress theme?  No delete button?

There’s 2 possible reasons you won’t see a delete button on your theme:

How to delete a child theme in WordPress

You can delete a child theme in the same way as any other, although you should double-check that any special code you added to your child theme’s functions.php or other files, is no longer needed.

To check if you are using a child theme or not, go to the Themes page and click on Theme Details for your active theme. If it’s a child theme, you will see a notice:

Delete a WordPress theme from the database

The above methods address the removal of theme files from your site.

But themes also store some information in the database. For example, any customization options are saved in the database and when you delete a theme this information may be left over. Additionally, a theme may have registered Custom Post Types and the content will be left behind when the theme is removed.

This kind of cleanup gets a bit more technical and it’s not strictly necessary. Consider the following to be “bonus” tips.

Removing theme-specific Custom Post Type content

Custom Post Types are additional types of content beyond the standard posts and pages.

When you activate a theme, if you see more menu tabs in your admin with items like Portfolio, Slider, etc, these are custom post types.

If you wish to clean these up after you’ve already deleted the theme, there is a handy plugin called Custom Post Type Cleanup.

This gives you a simple interface from which you can remove unused custom post types.

If you’ve installed and deleted multiple themes and plugins in the past, you may be surprised at how much unused content there is:

Before taking this step, I recommend you check your site to make sure you don’t need to retain the information from this content for any reason. If you do, you can use the option to re-register the post types temporarily, then you can copy/paste any content you want to keep into a file or into other posts/pages.

Is there any advantage to keeping this content?

If you think that you might reinstall the associated theme or plugin in the future, keeping the content will mean that it will magically reappear as soon as you reactivate that theme. But it you delete it, it’s gone forever (except for of course that database backup you have, right?!)

Removing theme-specific database entries

If you want to do a full surgical removal of everything in the database, you’ll need a tool like Advanced DB Cleaner PRO.

To test it, I went fishing for leftovers in the database after deleting the theme from the admin. Using this plugin I found several remnants and was able to successfully remove them:

The search is case sensitive, so searching for “jupiter” will find different entries than searching for “Jupiter”. I’m not picking on this specific theme – I found leftovers with others too because there isn’t really a standard way that themes clean up this kind of data on deletion.

This step probably isn’t necessary in the vast majority of cases, but it is just about the only way to to do a deep clean and thorough removal.

 I would certainly recommend making a database backup before using this or any plugin that removes content from your database….. just in case!

Deleting other theme-related content

In conclusion, deleting a theme from your site can be as simple as clicking a button in your WordPress admin. But if you want to get into the gory details you’ll need a couple of extra tools and a little technical know-how.