Clearing the theme cache

Last updated on
19 January 2019

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

The contents of the .info file are cached in the database, so Drupal will not automatically notice alterations to the .info file. Also, if you add new tpl.php files or override new theme functions, you must clear the theme cache before your changes will be activated.

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. Note 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

Help improve this page

Page status: No known problems

You can: