ads.txt explained: what it is, how to create it, how to verify it
ads.txt is a one-line text file that stops other people selling ad space on your domain. It is trivial to create and surprisingly easy to get subtly wrong.
6 min read · Last updated
What the file is for
ads.txt — Authorized Digital Sellers — is an IAB standard. It is a public list, hosted on your own domain, naming the companies allowed to sell advertising inventory on your behalf. Advertising buyers crawl it before bidding. If a supply source offers them inventory on your domain and that source is not in your file, the buyer treats the offer as unauthorised and ignores it.
The practical consequence for a publisher: without ads.txt, some buyers will not bid on your inventory at all, which quietly suppresses what you earn. With it, spoofed inventory claiming to be your site gets filtered out.
The line an AdSense publisher needs
For a site monetised with AdSense, the file contains one line, with your own publisher ID substituted in:
- google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
The four fields are: the domain of the advertising system, your account ID with that system, the relationship type, and the certification authority ID. For Google the relationship is DIRECT and the certification ID is always f08c47fec0942fa0 — that value is Google's, not yours, so it is identical on every site.
Your publisher ID is the pub- number shown in your AdSense account, the same one that appears in your ad code as ca-pub-followed by sixteen digits. In ads.txt you write it without the ca- prefix.
Where the file must live
- At the root of the domain: https://example.com/ads.txt. Not in a subfolder, not /files/ads.txt.
- On the same host visitors use. If your site canonically serves from www.example.com, buyers will look at www.example.com/ads.txt — make sure your redirects carry the file path across rather than dumping it at the homepage.
- Served as plain text. A file returned with an HTML content type, or a 404 page that returns status 200 with HTML in it, both count as missing.
- For subdomains, the file lives at the root of the domain unless you point to a subdomain file explicitly with a subdomain= record.
How to create it on common setups
- Static site or framework with a public folder: create ads.txt inside public/ (or static/) and redeploy. It is served at the root automatically.
- WordPress: use an ads.txt plugin, or upload the file to the web root over SFTP. Editing through a theme editor usually will not place it at the root.
- Shopify, Wix, Squarespace and similar: use the platform's built-in ads.txt field if it has one — several block direct file uploads at the root.
- Blogger and hosted platforms: the custom ads.txt setting in the platform's monetisation settings is the only route.
Verifying it properly
- Open https://yourdomain.com/ads.txt in a private browsing window. You should see the plain text line, not a styled page.
- Confirm the URL in the address bar has not redirected to your homepage or to a different host.
- Check the publisher ID digit by digit against your AdSense account. One transposed digit produces a file that looks fine and does nothing.
- Run the URL through an automated checker so a machine confirms status 200, a text content type and a parseable record.
- Give it time. Buyers re-crawl ads.txt on their own schedule, typically within a day or two.
AdSense may show an 'earnings at risk' warning for a missing or invalid ads.txt. The warning clears on Google's next crawl, not the moment you upload — a day or two of lag is normal.
Common mistakes
- Copying an example line from a tutorial and leaving somebody else's publisher ID in it. This authorises them, not you.
- Including the ca- prefix: ca-pub-… is for the ad code, pub-… is for ads.txt.
- Uploading to the wrong host — file at example.com/ads.txt while the site serves from www.example.com, or vice versa.
- A CDN or security layer serving a challenge page to crawlers at that path.
- Smart quotes or a comma from a word processor. Write it in a plain text editor.
- Deleting other networks' lines when adding Google. If you also use another ad partner, both lines belong in the file, one per line.
Does it affect approval?
Not directly. You cannot produce a complete ads.txt before you have a publisher ID, so a first-time applicant is not penalised for its absence. It becomes important the moment you are serving ads, because it determines how much of the buying market will bid on your inventory. Treat it as the first thing you do after approval, and verify it rather than assuming the upload worked.
Frequently asked questions
- Is ads.txt required for AdSense approval?
- No. It is required to protect your inventory once you are serving ads, and its absence can reduce revenue, but a first application is not rejected for lacking a file you could not yet complete.
- What is f08c47fec0942fa0?
- It is Google's certification authority ID within the ads.txt standard. It is the same for every publisher using Google — it is not a personal identifier and should be copied exactly.
- How long until Google sees my new ads.txt?
- Usually within 24 to 48 hours. Warnings in AdSense clear on Google's next crawl of the file rather than immediately after you upload it.
- Do I need ads.txt on subdomains?
- Buyers look at the root domain's file. If a subdomain is monetised separately, reference its own file from the root using a subdomain= record.
Check your own site
Run the free checker to see where your site stands on HTTPS, ads.txt, robots.txt, sitemap, viewport, policy pages, content depth and page speed.
Run the checker