Clearing the theme cache

Last updated on
12 January 2017

The contents of the .info file is cached in the database, so altering it will not be noticed by Drupal. Also if you add new tpl.php files or override new theme functions you will need to clear the theme cache before they will be active.

Do not confuse the cache with the theme registry. To clear the cache, do one of the following:

  • Click the "Clear all caches" button located under Performance. Remark that this button clears all caches, not only the theme cache. If you have a site with a lot of pages or a lot of traffic you might prefer to clear only the theme cache with one of the other methods below.
    • Drupal 7: Administration > Configuration > Development > Performance (admin/config/development/performance)
  • Other methods:
    • Admin menu has clear cache links beneath the home icon.
    • Devel Block module of the Devel project provides an "Empty cache" link.
    • The API function drupal_theme_rebuild (D7)
    • Some themes (Zen, Fusion, ...) provide a checkbox to rebuild the theme cache on every page, with a nice warning so you don't forget to turn this off.
    • Drush has a command line command: drush cc theme-registry.
    • The Magic module has a setting to 'Rebuild Theme Registry on Page Reload' that can be used with any theme.
  • Visiting the theme selection page will also clear the .info file cache.
    • Drupal 7: Administration > Appearance (admin/appearance)

If all of the above fails, you might also try to clear all caches