After install and setup of my Drupal site, I've noticed that Drupal has placed a few dirs/files in my file directory like css/js. Is it safe to remove these files when I move my site? What other cache dirs/files does Drupal generate?

  • Delete the files in sites/default/files/css and js, make sure Aggregate and compress CSS files and JS files are ticked in Performance UI and when you save on that UI these files are back, albeit with a different name to avoid browser cache issues. If aggregate and compress are not ticked these files aren't written. Apr 20, 2016 at 6:42

1 Answer 1


These are the dirs that Drupal 8 core places into your file directory:

  • config_HASH: This is a unique directory (where HASH is generated specifically for your site) that used for configuration management syncing.
  • css: This directory contains minified/compiled CSS files.
  • js: This directory contains minified/compiled JS files.
  • php: This directory contains compiled Twig PHP template files.

In general, if you're moving a site you can empty out the css/js/php directories; these are page cache generation artifacts and be cleaned out as long as you've emptied your site's cache aftering moving.

As for config_HASH, you'll want to keep it around in case you need to sync CM between environments. (e.g. adding/changing settings in a development then pushing those changes to staging/production environment).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.