I developed an installation profile that contains many various hooks. After an installation process, it is still included on every page, and all my installation hooks are executed. Please explain me why it happens, and by which way I can avoid including *.profile file after the installation.

  • 1
    I suspect that if you rename the files on the server that you will see errors in the logs. This should pinpoint where the include is happening.
    – mpdonadio
    Jun 27, 2011 at 19:51

2 Answers 2


This is a new feature of Drupal 7: install profiles behave like modules.

See #509398 : Install profiles should be modules with full access to the Drupal API and all it entails

Code that you don't want loaded during run-time should be moved to hook_install().

Edit - Xio asked about uninstalling a profile. variable_set('profile', 'standard'); might work.

  • If install profiles behave like modules there must be some way to uninstall them. drupal_uninstall_modules doesn't work with profiles.
    – ya.teck
    Jun 28, 2011 at 18:12
  • variable_set('profile', 'standard'); doesn't work for me. Probably I need remove profile from system table.
    – ya.teck
    Jun 29, 2011 at 8:10

Drupal will not include installation files after installation by default.

The best reason I can give to this problem, would be some custom code toy have made includes the files. With the limited information you have provided it's hard to answer with more detail.

If you want to "uninstall" a drupal install profile, this can be done by deleting the install_profile variable:


You should be aware that doing this will not allow you to use modules located in your install profile folder like you normally can when using install profiles.

  • I have several theme and preprocess functions in .profile file. It doesn't work in .install file.
    – ya.teck
    Jun 28, 2011 at 18:05
  • It works only in .profile file but don't in other files.
    – ya.teck
    Jun 28, 2011 at 18:17

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.