Ads.txt Validation Test
What is it?
Ads.txt is a public, machine-readable file that lists the advertising vendors authorized to sell a site's inventory programmatically. Introduced by the IAB Tech Lab to combat domain spoofing in the supply chain, it is now required for inclusion in many premium advertising marketplaces, and a missing or malformed file typically means reduced demand and lower CPMs. This test checks the format of your site's ads.txt file so authorized sellers are correctly declared and the document parses cleanly for buyers and exchanges.
Why ads.txt matters
Programmatic advertising has long had a problem with bad actors selling fake inventory under the guise of premium publishers' domains. Ads.txt solves this by giving every publisher a public, machine-readable way to declare which sellers are authorized to monetize their inventory. Buyers and ad exchanges check the file before bidding, and any seller not listed is treated as unauthorized.
For publishers, the consequence of a missing or malformed ads.txt is reduced demand and lower CPMs: many advertisers refuse to bid on inventory from domains without a valid ads.txt, and many ad exchanges reduce the priority of unverified inventory. Maintaining the file is a low-effort, high-impact ongoing task for any site that runs programmatic ads.
Common ads.txt issues
- File missing entirely, leaving authorization unverifiable.
- File at the wrong path: ads.txt must be at the domain root, not in a subdirectory.
- Wrong relationship value: only
DIRECTandRESELLERare valid; other values fail validation. - Stale entries from partners no longer in use, which spoofers can exploit.
- Returning HTML instead of plain text: the file must be served as
text/plain.
This test validates the format of your site's ads.txt file. The fix guide below covers creating and publishing the file, the syntax for direct and reseller relationships, the parallel app-ads.txt file used for mobile inventory, and audit cadence for keeping authorized seller lists current.
Pass rate:
-
Top 100 websites: 67%This value indicates the percent of top 100 most visited websites in the US that pass this test (in the past 12 months).
-
All websites: 5%This value indicates the percent of all websites analyzed in SEO Site Checkup (500,000+) in the past 12 months.
| 2021 | 80% |
|---|---|
| 2022 | 66% |
| 2023 | 68% |
| 2024 | 67% |
100
75
50
25
0
How do I fix it?
The ads.txt file is a public list of the advertising vendors authorized to sell your inventory programmatically. A correctly formatted ads.txt protects against domain spoofing in the ad supply chain and is required for inclusion in many premium advertising marketplaces. Fixing this issue means publishing a valid ads.txt at the site root with current authorized seller entries.
Example
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
example-ssp.com, 12345, RESELLER
contact=ads@example.com
Where to make the change
- Raw HTML or static site: upload
ads.txtto the site root so it is served athttps://example.com/ads.txt. - WordPress: use a small plugin or upload the file via FTP. Some advertising plugins manage it automatically based on connected accounts.
- Shopify: upload the file through the theme code editor as an asset, then expose it at the root via a route configuration.
- Cloudflare or similar CDN: serve ads.txt from a worker if you do not have file-system access at the origin.
Common causes and how to resolve them
- File missing: create one with at least your direct advertising relationships.
- File at the wrong path: ads.txt must be at the domain root, not in a subdirectory.
- Wrong relationship value: use
DIRECTfor direct seller relationships,RESELLERfor authorized resellers. Other values are invalid. - Stale entries: partners change; remove relationships you no longer have so spoofers cannot exploit them.
- Returning HTML instead of plain text: the file must be served as
text/plain. A page that returns HTML or a 404 fails validation.
Best practices
- Audit quarterly: stale entries are the main source of ads.txt vulnerabilities.
- Mirror app-ads.txt for mobile inventory: apps use a parallel
app-ads.txtfile with the same syntax. - Add a contact line: include a
contact=email@example.comline so vendors can reach the right person about ad-quality issues.