When deleting unused or broken WordPress themes be aware a theme must be active for WordPress to work (the folder /wp-content/themes/ cannot be empty).
Under the /wp-content/themes/ folder you should see at least one of the default WordPress themes.
As you can see in the screenshot above on my server there’s two of the default WordPress themes, TwentyFifteen and TwentyFourteen.
I’m currently running the Stallion Responsive Child Theme, if I deleted either of the folders /stallion-responsive/ (folder for the Stallion Responsive Parent theme) or /stallion-responsive-child/ (folder for the Stallion Responsive Child theme) the latest available default TwentyFifteen theme would activate: I’m running WordPress 4.6.1 in the screenshot.
At the time of writing the latest default theme available to my site is TwentyFifteen, if the SEO theme I develop, Stallion Responsive (or the Stallion Responsive Child theme) broke on my site and I couldn’t log into the WordPress Dashboard I’d delete the /stallion-responsive/ folder.
When I access the site again WordPress will automatically activate a default theme (Twenty Fifteen) so I can log back into the sites Dashboard.
That should get you back into your WordPress Dashboard when a faulty theme takes a site down.
Update: Did some digging through WordPress 4.6.1 code and figured out what would happen if the active theme folder is deleted, there’s a fallback theme feature.
The Fallback WordPress Theme
The fallback theme is the WordPress theme WordPress will activate if you delete the active themes folder (as described above) or if the themes style.css file is missing: means you could deactivate a theme by deleting or renaming the themes style.css file.
In WordPress 4.6.1 the fallback theme is Twenty Sixteen if the /twentysixteen/ theme folder exists.
Twenty Sixteen is not installed by default if you’ve upgraded WordPress from an earlier version before Twenty Sixteen existed. If the /twentysixteen/ folder doesn’t exist, WordPress 4.6.1 checks through this list until it finds a default theme that exists.
Updated December 2019 for WordPress 5.3
/twentytwenty/ = Twenty Twenty Theme
/twentynineteen/ = Twenty Nineteen Theme
/twentyseventeen/ = Twenty Seventeen Theme
/twentysixteen/ = Twenty Sixteen Theme
/twentyfifteen/ = Twenty Fifteen Theme
/twentyfourteen/ = Twenty Fourteen Theme
/twentythirteen/ = Twenty Thirteen Theme
/twentytwelve/ = Twenty Twelve Theme
/twentyeleven/ = Twenty Eleven Theme
/twentyten/ = Twenty Ten Theme
/default/ = WordPress Default Theme
/classic/ = WordPress Classic Theme
If none of these exist, WordPress won’t have a theme to fallback on. Solution is download one of the default WordPress themes and upload it to /wp-content/themes/ using FTP.
As you can see in my WordPress installation (screenshot) I have these two folders under /wp-content/themes/ :
/twentyfifteen/
/twentyfourteen/
If I deleted the active theme (Stallion Responsive or the Stallion Responsive Child Theme), WordPress would fallback to Twenty Fifteen.
Update December 2019.
Lots on WordPress updates since I first wrote this article, currently running WordPress 5.3 and have the latest default WordPress theme. If I deleted the active theme (Stallion Responsive or the Stallion Responsive Child Theme), WordPress would fallback to Twenty Twenty because I have the default theme Twenty Twenty available.
/twentytwenty/
It’s good WordPress security to delete themes and plugins you aren’t using, they are a potential entry point for hackers. More plugins/themes you have, more likely one is carrying a security flaw, if you aren’t using a theme or plugin, get rid of it, but keep one default WordPress theme. I currently have Stallion Responsive Parent theme, Stallion Responsive Child theme and the Twenty Twenty default theme: that’s all, I delete old default themes, you should too.
Continue Reading How to Manually Delete a WordPress Plugin Using FTP