Attached is a file with a set of commands to simply list, enable, disable themes in a site. This is the complete set of commands:

theme status          Show current status of theme configuration in the site.
theme list            List all the available themes for the site.
theme info            List all info about a theme.
theme set default     Set the default theme.
theme set admin       Set the administration theme.
theme enable          Enable a theme.
theme disable         Disable a theme.

It has been tested with drupal 6.x. Must review if compatible with 5.x and 7.x

I include also a dump of a session using the commands:

$ drush theme list
Nombre       Título                    Enabled/Disabled  Predeterminado
STARTERKIT   Zen Themer’s Starter Kit  disabled          No            
zen_classic  Zen Classic               disabled          No            
marvin       Marvin                    disabled          No            
minnelli     Minnelli                  disabled          No            
pushbutton   Pushbutton                disabled          No            
chrysalis    Chrysalis                 enabled           No            
zen          Zen                       enabled           Si            
bluemarine   Bluemarine                enabled           No            
chameleon    Chameleon                 enabled           No            
garland      Garland                   enabled           No            
$ drush theme status
Default theme: <em>zen</em>
Administration theme: <em>garland</em>
Other enabled themes: chrysalis bluemarine chameleon garland
$ drush theme info garland
Name: garland
Title: Garland
Description: Tableless, recolorable, multi-column, fluid width theme (default).
Version: 6.13
Core: 6.x
PHP: 4.3.5
Engine: phptemplate
Regions: Left sidebar, Right sidebar, Content, Header, Footer
Features: comment_user_picture, favicon, mission, logo, name, node_user_picture, search, slogan, primary_links, secondary_links
  media: all
    files: themes/garland/style.css
  media: print
    files: themes/garland/print.css
  files: themes/garland/script.js
$ drush theme set default zen
Setting zen as default theme                                                                                       [success]
$ drush theme set admin garland
Setting garland as admin theme                                                                                     [success]
$ drush theme enable marvin
Enabling marvin                                                                                                    [success]
$ drush theme disable zen
drush: zen is the default theme. You must set another theme as default before trying to disable this one.
Drush command could not be completed.                                                                              [error]
$ drush theme disable marvin
Disabling marvin                                                                                                   [success]


jonhattan’s picture

Forgot to say any comment on the code is very welcome as I don't know drush very deeply.

jonhattan’s picture

Title:drush commands to administer themes activation et al» drush commands to administer themes
Status:Needs work» Needs review
new10.26 KB

New attached file is tested with drupal versions 5, 6 and 7 (with patch from #537280: D7 compatibility). Changes are:

* added some help text (implementation of drush_hook_help())
* new command: drush theme list enabled
* both theme list and theme list enabled has a new column indicating if it is the administration theme.

The only drupal version specific code is the one to show the theme info, as drupal 5 themes does not have the same info object as versions 6 and 7.

Note: in order to use it download the attachment to ~/.drush/theme/

jonhattan’s picture

I've placed the code in my cvs sandbox

new changes:
* all strings now go through dt()
* use of new _drush_get_themes()

any suggestion on other features/commands?

MacMladen’s picture

I am fascinated with drush and use it whenever I can.

I was puzzled as why it doesn't handle themes and then I saw your addition. Why is it not part of standard drush?

I tried to implement it but did not succseed: i made ~/drush/theme/ folder and placed there but drush did not recognize it?!

I tried to move it to ~/drush/ and ~/drush/includes but still it didn't work.

Can you tell me what am I doing wrong?

You should include some more detailed information on installation and operation of commands. Drush is very powerfull and someone could easily do some irreparable damage so I hope you took precautions like backing up theme prior to upgrade.

Does your theme command works with multisite installation?

People usualy forgot that their subtheme might not work with new version of the theme. They also tend to forget that they changed the original theme in code while not changing name so upgrade could actually destroy developed theme (I've done that).

gojruht’s picture


Seems to be a nice hack, but having the same problem here. I downloaded the file, named it and put it under ./drush/theme/

# drush -d theme status
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.063 sec]                   [bootstrap]
Initialized Drupal 6.13 root directory at /home/homes/satya/public_html/D6 [0.092       [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.1 sec]                     [bootstrap]
Initialized Drupal site default at sites/default [0.211 sec]                            [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.219 sec]          [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.24 sec]                [bootstrap]
Successfully connected to the Drupal database. [0.241 sec]                           [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.263 sec]                   [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [1.26 sec]                   [bootstrap]
The command 'drush.php theme status' could not be found. [1.281 sec]                 [error]

Can you provide some additional info on installation, would be very much appreciated!

jonhattan’s picture

Instructions in #2:


.drush is a directory inside the home directory of the user you are running drush as. It starts with a dot. It is .drush and is not the directory where you installed drush. It is just drush the standard way of doing it, as explained in drush documentation.

gojruht’s picture

Works perfectly, thank you for the hint.

barraponto’s picture

johnathan version from CVS returns Fatal error: Call to undefined function _drush_get_themes() in ~/.drush/theme/ on line 302. 09080 version works alright, anyway.

jonhattan’s picture

barraponto: this extension works against drush HEAD, where drush_get_themes() was introduced for D7 compat.

Manuel Garcia’s picture

Thanks jonhattan!

Where are the maintainers of this proyect?? Looks to me this would be a nice feature to have, and looks to be done (or nearly there).

Manuel Garcia’s picture

Status:Needs review» Reviewed & tested by the community
moshe weitzman’s picture

Assigned:Unassigned» Owen Barton
ChrisRut’s picture


rodibox’s picture

Sorry, if I do not understand something, I am using drush usually I think your development is very good.
Inside the Drush directory, I make theme directory and put the file
ls -l drush

ls -l drush/theme


drush -r /var/www/sitios//DRUPAL6/multidrupal -l sitioprueba.arg theme list
The command 'drush theme list' could not be found. [error]
We must do something more? to run commands theme


Matt V.’s picture

Rodibox, see comment #6 above. The directory & file need to go in the .drush directory, which is a subdirectory of your home directory. For example... /home/rodubox/.drush

rodibox’s picture

Sorry I'm more stupid every day

Thank you for the excellent complement, I find it very helpful.

Alan D.’s picture

The enable + set default are working nicely. a big plus 1 for inclusion

I am running DRUSH commands via the apache user on a multisite install and I'm almost always logged into shell via root. So to help others with that 2 min search to find out how to install this for ANY user, just place it here:



# ls -al drush/commands/
drwxr-xr-x 3 root root 4096 Dec  7 16:18 core/
drwxr-xr-x 5 root root 4096 Dec  7 16:18 pm/
drwxr-xr-x 2 root root 4096 Dec  7 16:18 simpletest/
drwxr-xr-x 2 root root 4096 Dec  7 16:18 sql/
drwxr-xr-x 2 root root 4096 Dec 15 11:11 theme/

# ls -al drush/commands/theme/
-rw-r--r-- 1 root root 10511 Dec 15 11:11

moshe weitzman’s picture

Status:Reviewed & tested by the community» Needs work

This is very nice. I'll bet many people are happily using it.

My hesitation is with adding a parallel set of commands for themes. In Drupal 7, modules and themes are looking more and more alike (and install profiles too). For example, themes can also participate in alter hooks and are now duplicate names are disallowed between modules and themes.

I'd be interested in a patch which unifies modules and themes better (like dl does, for example).

jonhattan’s picture

new10.56 KB
new771 bytes

Attached is a patch with this change to drush: use `list_themes($refresh=true)` instead of `_system_theme_data()` in `_drush_get_themes()` for both and

=> _system_theme_data() is only for drupal 6. It is not available for d5 and d7.
=> list_themes() is available for all versions, use the database if possible and includes theme status (`_system_theme_data()` doesn't).

Attached also a new version of themes command file with those changes:
* spaces to dashes!
* use db_update for d7 instead of db_query

Moshe: I'll work in unification and/or integration whenever possible. I think of those changes:
* remove `theme-status`
* integrate `theme-list` with `pm-status` or `pm-list` as proposed in #678574-12: Add "pm-" namespace to all of the pm commands. With that integration we loose two columns: Default and Administrative theme. That info can be moved to `status` (core).
* in concordance with the proposal at #679020: Extend `pm-list` to list modules, themes and profiles and filter by project status (enabled|disabled|uninstalled...) `theme-list-enabled` could be `pm-list --status=enabled`.
* `theme-info` can land to a new pm-info (if info command is renamed to pm-releases). New code will be written to provide also pm-info for modules (aka `module-info`)
* `pm-enable` and `pm-disable` will be extended to include `theme-enable` and `theme-disable`
* `theme-set-default` and `theme-set-admin` are theme specific operations and can stay the same, or renamed but there's no place for integration with other commands.

joeebel’s picture

I installed (per #17 - in /root/drush/commands/theme/). I get no output to my ssh login terminal (logged in as root). After the command 'drush theme-status' is entered on the command line in a valid Drupal root directory, it just sits for a few seconds, then the prompt returns.

[root@drupal1 public_html]# drush theme-status
[root@drupal1 public_html]# drush theme-list
[root@drupal1 public_html]#

No output, no results. What did I miss? All other drush functionality is working. Centos 5.4, Apache 2.2, PHP 5.2, MySQL 5.0.

[root@drupal1 public_html]# drush status
  PHP configuration : /etc/php.ini
  Drupal Root       : /home/mydomain/public_html
  Drupal version    : 6.14
  Site Path         : sites/default
  Site URI          : http://default
  Database Driver   : mysqli
  Database Hostname : localhost
  Database Username : root
  Database Name     : my_db
  Database Password : mypassword
  Database          : Connected
  Drupal Bootstrap  : Successful
  Drupal User       : Anonymous
[root@drupal1 public_html]#
moshe weitzman’s picture

Anything left to do here?

jonhattan’s picture

Already in drush HEAD:

theme-list => pm-list --type=theme
theme-list-enabled => pm-list --type=theme --status=enabled
theme-info => pm-info

Currently working on a patch for pm-enable/disable for themes.

* `theme-status`. could be status-theme although I prefer adding two lines (default and admin theme) to drush status.
* `theme-set-default` & theme-set-admin`. Can stay the same. Is the place for them?

moshe weitzman’s picture

IMO, we don't truly need `theme-set-default` & `theme-set-admin`. Folks can use vset for that ... The rest looks good. Adding 2 lines to status sounds good for now.

jonhattan’s picture

2 lines for status shipped in #693958: Extend pm-enable/disable to manage themes.

vset is fine, in despite of default theme must be already enabled.

happily closing this issue!

For the record:

This issue has been dismissed in favor of a closer integration witih drush package manager which has been worked out in other issues. Drush 3.x will be available soon. Upgrade your installation and remove

This is the change in commands:

theme-enable        => pm-enable
theme-disable       => pm-disable
theme-info          => pm-info
theme-list          => pm-list --type=theme
theme-list-enabled  => pm-list --type=theme --status=enabled
theme-set-default   => vset theme_default
theme-set-admin     => vset admin_theme
theme-status        => status theme
jonhattan’s picture

Status:Needs work» Closed (fixed)
vparfaniuc’s picture

Component:Code» PM (dl, en, up ...)

Hi Guys,

I'm trying to install the this extension to drush on my ubuntu machine, but I can't find any ~/.drush/ folder in my hard drive, I was using installation guide described here Does anyone have any idea of how to install this file in my drush installation way? Thank for your help

Circlefusion1’s picture


Read jonhatton's last post.

His wording might be confusing, but basically Drush 3.0 has features in it that are comparable to jonhatton's proposed theme-* commands.

So you don't need to use his file.
Use the en, dis, pm-* and vset commands instead.

batigolix’s picture

Version:» 8.x-6.x-dev

For those who find this issue via Google: you can change the themes using the drush' vset command:

For example:

drush vset theme_default bluemarine
drush vset admin_theme shiny
MacMladen’s picture

This is really fascinating, to see next post after 4 years!

Still, Jonhattan I do believe this one is needed even if gods say it is not! Please just make sure it is compatible with latest 8.x-6.x version.

First of all, commands must be dash connected like theme-status and should have abbreviation like thst

As for the commands, I'd suggest some "economy":

theme-status          Show current status of theme configuration in the site.
theme-list            List all the available themes for the site.

Those are redundant or at least should operate differently. While status may be omitted and put all info to theme-list (making status an alias), you can use status just to list default and admin theme, and list to give list of all themes, enabled/disabled and added default/admin to those that are default/admin.

theme-info            List all info about a theme.

This is good one and rich one, very nice to avoid the need for browser, but it should not give too much information as on region, CSS and JS the screen could be just too much filled with information that is not too relevant to what you can do with info — it is way to easier to open particular info file for details. But heading information are welcome and also a path to theme (where is it in Drupal and file system) so one can copy path and cd <paste> to go there.

theme-default     Set the default theme.
theme-admin       Set the administration theme.

This is shorter, more concise version. Maybe if there is some opposite command like unset but there are not. Maybe if not given argument could print and if valid argument is given then set.

theme enable          Enable a theme.
theme disable         Disable a theme.

These are really not needed as they are included in enable and disable.

To the drush gods: I can agree to some degree about some of the points but I personally think this is a good thing and helps both beginners and experienced users.