AdsTxt
This module provides a standardized ads.txt file to declare authorized sellers of advertising inventory, improving transparency for programmatic buyers and preventing the sale of counterfeit media.
Manage your ads.txt and app-ads.txt files from the Drupal admin UI — no
server access, no deployments, and a separate file for every site in a
multisite install.
ads.txt (Authorized Digital Sellers) is the IAB Tech Lab standard that lets
publishers declare who is allowed to sell their ad inventory. Ad networks
such as Google AdSense check it before buying. Without a valid file, your
programmatic ad revenue can suffer.
WHY USE THIS MODULE
Normally ads.txt is a static file in your docroot. That is a problem if you
run Drupal multisite, because every site shares one docroot and therefore
one file. It is also awkward if your marketing team needs to update the file
but does not have server access or a deploy pipeline.
This module serves both files dynamically from Drupal, so each site gets its
own content, editable in the browser.
FEATURES
- Edit ads.txt and app-ads.txt from the admin UI
- Per-site files in a multisite install
- Served at /ads.txt and /app-ads.txt with the correct text/plain header
- Fully cached, and cleared automatically when you save
- Imports any existing ads.txt file when you install the module
- Lets other modules add lines programmatically
- -No server
or filesystem access needed
REQUIREMENTS
Drupal 10.2, 11 or 12. No dependencies.
INSTALLATION
composer require drupal/adstxt
Then enable the module as usual.
CONFIGURATION
Go to Administration > Configuration > System > Ads.txt
(/admin/config/system/adstxt) and paste in your content. You need the
"Administer ads.txt" permission.
If a physical ads.txt file exists in your docroot, remove it — the web
server will serve that instead of Drupal. The status report will warn you.
FOR DEVELOPERS
Other modules can append lines and declare their own cache tags using
hook_adstxt() and hook_app_adstxt(). See adstxt.api.php.
MORE INFORMATION
- About ads.txt: https://iabtechlab.com/ads-txt/
- app-ads.txt for mobile and CTV apps: https://iabtechlab.com/ads-txt/
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 8.x-1.5 | Stable | 10–11 | Aug 24, 2026 |