Title: Remove theme with code
Last modified: January 14, 2017

---

# Remove theme with code

 *  Resolved [Oscar Abad Folgueira](https://wordpress.org/support/users/oabadfol/)
 * (@oabadfol)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/remove-theme-with-code/)
 * Hi to all.
 * Now I want to delete themes with code.
 * I can’t find any hook or function in the API to do this.
 * Anyone knows how can I remove themes with code?
 * Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Oscar Abad Folgueira](https://wordpress.org/support/users/oabadfol/)
 * (@oabadfol)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/remove-theme-with-code/#post-8654009)
 * Hi again.
 * I just found the “delete_theme()” function.
 * Now, I need to get all inactive themes and delete all.
 * The function get_themes() give me all themes but I need only the unactivated 
   themes.
 * Someone?
 * Regards.
 *  [doubleedesign](https://wordpress.org/support/users/doubleedesign/)
 * (@doubleedesign)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/remove-theme-with-code/#post-8654072)
 * Is there a reason you can’t do this from the dashboard?
    If so, do you have FTP
   access? If you know the names of the themes you need to remove you can just delete
   their folders.
 *  Thread Starter [Oscar Abad Folgueira](https://wordpress.org/support/users/oabadfol/)
 * (@oabadfol)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/remove-theme-with-code/#post-8654090)
 * Hi, Lessa W.
 * No, I’m writing a plugin to do some initial tasks and this is one of them.
 * Regards.
 *  Thread Starter [Oscar Abad Folgueira](https://wordpress.org/support/users/oabadfol/)
 * (@oabadfol)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/remove-theme-with-code/#post-8654093)
 * Well, I found the solution.
 * The solution is to use the object of wp_get_theme() and the ‘TextDomain’ property.
 * Bye.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Remove theme with code’ is closed to new replies.

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [remove](https://wordpress.org/support/topic-tag/remove/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 2 participants
 * Last reply from: [Oscar Abad Folgueira](https://wordpress.org/support/users/oabadfol/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/remove-theme-with-code/#post-8654093)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
