I've seen plenty of guides saying why it's a good thing to organise modules in different folders... (and I'd agree) e.g.:

...and how to move the modules to the new place(s) after installation

... but these haven't worked for me, perhaps I need to try again. My site broke, even after trying the registry rebuild and clear cache many times.

So my question is this: How can I run the installation of Drupal to set up the modules to be installed in different folders (e.g. like in examples http://befused.com/drupal/module-directory-structure )?

There doesn't seem to be anything out there if you want your module paths (sub-folders) structured in a certain way, right from the beginning. NOT after the fact.

I want the folders to be set up in the first place, right from the beginning. So example, whenever I use drush to download a contrib module, the module is placed in the contrib sub-folder: sites/all/modules/contrib for example.

Some other references:

1 Answer 1


Actually it seems like all you need to do is just create a folder called contrib in /sites/all/modules

when I issued drush dl views (at the docroot/install top level root of my site), drush put the views module in the contrib folder

as for features - you specify where you want the module to go when you (re)create the Feature (in the Feature section of the Drupal config)

as for custom - I'm hoping that Drupal will discover custom modules here - but is discovering, rather than a setting determining the path, a good thing?

Thought I'd still ask the question even after I'd found an answer, didn't want to waste the effort in making the question - hope someone else finds it useful.

Please provide your own answer or comment to enhance what I found.

  • 1
    Did you try to rebuild the registry using drupal.org/project/registry_rebuild? I usually build a site inside a custom installation profile and by using make files specify which folders different modules and themes should go into. I usually place custom modules under /profiles/MYPROFILE/modules/custom and contrib modules goes in /profiles/MYPROFILE/modules/contrib Jun 19, 2014 at 7:47
  • +1 Great tips thanks Pontus Nilsson - I did try registry rebuild - I think I'd moved my modules into certain folders, it didn't work out (errors) then moved them back to the original place (still errors) and then tried registry_rebuild to sort it all out, but it wouldn't install. So now when I remember more of what happened, I think what would have worked would be to have installed registry_rebuild before attempting to move any modules to other folders. Jun 19, 2014 at 11:06
  • That said I prefer the idea of having everything in the certain folders (contrib, custom etc) in the first place so your input on install profiles is something I'd want to explore. Jun 19, 2014 at 11:07
  • Be aware that registry_rebuild isn't a module. It's a php script, see the documentation for more info. Jun 19, 2014 at 12:37

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.