Policy on advertising in projects

Last updated on
24 May 2022

Is it OK to include advertising in Drupal modules and themes? If so, how and where? These guidelines are aimed at outlining best practices.

Note that policy here was promoted in this page over a period of years and in Review and finalize "Guidelines regarding advertising and Drupal projects". Policy changes, when required, can be initiated in the Governance Issue Queue.

Keeping modules and themes usable

As with any other UI consideration, advertising in modules and themes should be approached with the needs and interests of users in mind. A good question to ask is, "Will all or almost all users of this module or theme wish to have this feature?" If the answer is no, then the feature should probably be left out. At the very least, it should be an admin-configurable option that is off by default and can be easily disabled when present.

The drupal.org infrastructure is offered to enable the sharing of extensions that anyone can use and enhance. Many or most site developers will not wish to have advertising on their sites.

For pretty obvious reasons, site developers should be able to use a module or theme without having to resort to hacking the code to remove hard-coded features that no one wants.

Including advertising in module and theme code can severely limit the reach and usefulness of your contribution.

Where is advertising appropriate?

  • In README files. It's generally considered acceptable to include a modest amount of advertising in a README file that accompanies a module or theme download. An example would be a link or two to companies that produced a module or to a favorite charity that module users are encouraged to donate to.
  • On project pages. On the drupal.org project page you can also include some advertising on the project page for a module or theme. An example might be an appeal for financial contributions to help support further development.
  • When it's a necessary part of integrating an external product. Some modules are focused on integrating an external product or service. In that case, it might not make much sense to try to integrate without mentioning the product or service name. Or for example, an external widget might come with logos or similar advertising that cannot be disabled (e.g., a YouTube embed).
  • When it's something many site developers will want, it's admin-configurable, and it's disabled by default, see below.

How can I make advertising admin-configurable?

Some advertising is indeed a feature that many users will wish to enable. An example is a "powered by" block, which site developers might be proud to display.

If you want to include such in your module, a good model is the "Powered by Drupal" block included in Drupal core. See system_block() for sample code. Note also the help message given in system_help() (see case 'admin/build/block/configure'), emphasizing that the block is in no way required.

For theme developers, [insert good sample reference here].

Can a module or theme hosted on drupal.org forbid users from removing advertising?

The GPL under which all drupal.org hosted code is licensed allows the free modification of code, providing the conditions of the GPL are maintained. Requiring advertising as a condition of use would place an additional restriction and so would be incompatible with the GPL. In short, nope, they can't.

What should I do if I find advertising that doesn't follow these best practices guidelines?

A good first step would be to file an issue on the module or theme, citing these guidelines and making a specific suggestion for how the issue could be resolved. You can work from there to help a module or theme contributor understand why and how s/he can reduce the barriers to use that advertising can present.

Help improve this page

Page status: No known problems

You can: