Warning message

Documentation is currently being migrated into the new system. Some pages might be temporarily missing, and some guides might appear empty. Thank you for your patience while we are improving Drupal.org documentation.

Clearing the theme cache

Last updated on
August 31, 2016 - 13:54

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)
    • Drupal 6: Administer > Site configuration > Performance (admin/settings/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) or drupal_rebuild_theme_registry (D6).
    • 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)
    • Drupal 6: Administer > Site building > Themes (admin/build/themes)

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