A plain text file about a dozen lines long can decide whether advertisers pay you. It sounds like exaggeration until a site’s ad revenue sags because one seller line was missing or mistyped. ads.txt is among the few corners of ad tech that a small publisher controls completely, and a first pass often fits inside an hour.
What the file is for
Ad fraud has a simple form. Someone pretends to sell space on a site they do not own, copies your domain into bid requests, and pockets the advertiser’s money. You see none of it. The advertiser believes the ad ran on your pages, and it never did.
ads.txt, short for Authorized Digital Sellers, is the publisher’s public answer. It is a list on your own domain naming the companies allowed to sell your inventory. Buyers and ad platforms can check it before they spend, and a seller missing from the list may be skipped by buyers who only bid on verified sellers. The format comes from the IAB Tech Lab, the industry body behind many ad tech specifications; its current specification is published on its website.
The file does not stop fraud by itself. It does not prove your traffic is real either. What it does is reduce the question to one that is easy to check: is this seller on the list?
Reading one line
Each line describes one relationship, in comma-separated fields. A typical line looks like this, with a placeholder publisher ID:
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
Four parts, then.
- Domain of the ad system. The platform that sells your space, such as an ad network or exchange.
- Your account ID. The identifier that platform gave you. Copy it exactly, because one wrong digit points at a different account.
- Relationship. DIRECT means you hold the account with that platform. RESELLER means the platform may sell your space through another party.
- Certification authority ID. An optional field identifying the platform in a trade-body registry. Platforms usually hand you the whole line, this value included.
Lines that start with a hash symbol are comments. Use them to note which partner each line belongs to and when you added it.
What sellers.json adds
ads.txt is the publisher’s list. sellers.json is the other half of the handshake: ad platforms publish their own file listing the accounts they sell for, so a buyer can match the seller ID in a bid request against the platform’s record. Entries typically show a name and domain and say whether the seller is a publisher or an intermediary, although some platforms mask details for privacy.
You neither write nor host this file. Your job is to know it exists. It is how buyers confirm that the ID in your ads.txt belongs to you, and it is a quick test of whether a partner is transparent. A company that wants to resell your inventory yet refuses to publish seller information deserves a question.
Your ads.txt declares which sellers you trust. Their sellers.json answers that each one is real and says who it is. A buyer who sees both lined up is more comfortable bidding.
Setup checklist
This is the whole job, in order.
- Gather your partners. List every ad network, exchange and header bidding vendor you use. On an inherited site, check old tags and plugins for forgotten ones.
- Get each partner’s line. Serious platforms publish the exact line to add, usually in help pages or account settings. Copy it as given. For Google AdSense, the help center shows the line with your publisher ID.
- Create a plain text file named ads.txt. Use a plain text editor, not a word processor. One entry per line, UTF-8 encoding.
- Upload it to the root of your domain. It must load at yourdomain.com/ads.txt. A file in a subfolder is ignored.
- Test it in a browser. You should see plain text: no HTML, no login page, no redirect loop.
- Check each ad dashboard. Most platforms report whether they can find a valid entry for your domain.
- Calendar a review. Revisit the file whenever you add or remove a partner, and every few months otherwise.
Subdomains and WordPress
The root domain is the default location. If your site lives on a subdomain, read each platform’s guidance on how it looks the file up, because subdomain rules are specific and behavior can differ. On WordPress, upload through your host’s file manager or an FTP client; some ad plugins also offer an editor. A caching plugin or CDN rule can serve an old version, so clear the cache after every edit.
Partners that hand over long lists
Header bidding and managed monetization vendors often supply a long list, sometimes dozens of lines, since they route requests through many exchanges. That is normal. Paste the full list and keep the vendor’s name in a comment above it. Trimming lines to save space switches off demand without telling you.
Agree in advance who updates the file when the vendor’s list changes.
If a new partner asks you to list a company you have never heard of, ask who it is. A legitimate vendor can explain its supply chain in two sentences. Every RESELLER line gives that company permission to sell your space, so the file is a record of trust, not a formality.
Several sites, one account
Each domain needs its own file. Reusing an account ID across sites is normal. Copying a file wholesale from one site to another can carry lines that do not apply. Review each file separately, and keep a short sheet with the domain, the partners, the date of the last check and the person responsible.
If you use only AdSense
Google calls the file not mandatory but highly recommended, and ads can serve without it. A missing file shows as “Not found” in AdSense, and a missing publisher ID shows as “Unauthorized”. Either can limit which buyers are willing to bid. The file is tiny and free, so the trade is lopsided. Check Google’s current instructions for the exact line and for any warnings in your account. If you also publish a mobile app, a sibling file called app-ads.txt exists for that case.
A worked example
Say a small publisher runs AdSense and one managed header bidding vendor. The vendor’s onboarding page lists six lines, one per exchange, all marked RESELLER. The file then holds the AdSense line marked DIRECT plus the vendor’s six, with a comment above each group naming the partner and the date added. Seven lines. Correct.
Now say the publisher later drops the vendor but leaves those six lines behind. Nothing breaks. Yet the publisher is still authorizing six sellers that no longer work on its behalf, and each stale line is an unneeded permission. Remove what you no longer use.
Mistakes that cost revenue
The file sits in the wrong place, or behind a redirect that sends it to the home page. An ID is typed by hand and one character swaps. The file is saved from a word processor, which can add hidden formatting or smart quotes. A new partner is switched on before its lines are added. A security plugin or firewall rule blocks crawlers from the file. A relationship is marked DIRECT when it is really RESELLER, or the reverse.
Most of these surface as a dashboard notice within a day or two, and fixing them is quick. The slower problem is the one nobody sees: fill rates slip quietly because the warning email went to an old address. Make sure the contact email on every ad account is one you read.
When a dashboard shows a warning
Do not change five things at once. First load the file in a browser and confirm it is reachable and clean. Next compare the flagged line with the platform’s help page, character by character. Then check whether a cache or CDN is serving an older copy. Last, wait, since crawlers refresh on their own schedule. Google’s AdSense help says changes can take a few days, and longer for sites with few ad requests. If the warning survives all that, send the platform’s publisher support the URL and the line in question.
Protecting the file itself
Treat ads.txt like any file that controls money. Restrict who can edit it on your server or CMS, because anyone with access could add their own seller line and divert your revenue. Check it now and then for lines you do not recognize. They signal either a forgotten partner or tampering. If an agency or freelance developer touches your site, ask them to tell you when they change it.
Keep a dated copy somewhere outside the website, even in a notes document. A migration, a theme change or a plugin update can wipe the root folder, and a saved copy turns a rebuild from ten help pages into a one-minute restore. Site moves are a common moment for this file to vanish, and the revenue dip that follows is easy to blame on something else. After any migration, load the address in a browser before anything more complicated.
The first check to make today
Open yourdomain.com/ads.txt in a browser. A clean list with one line for every partner you use means you are done until your next change. An error page or a blank screen means the checklist above is your next stop, starting with your ad network’s help page for the exact line.
Frequently asked questions
What is ads.txt?
It is a plain text file on your domain, at yourdomain.com/ads.txt, that lists the companies authorized to sell your ad space. Buyers check it to avoid paying fraudsters who pretend to be you. The format is maintained by the IAB Tech Lab.
What is the difference between ads.txt and sellers.json?
ads.txt is published by the publisher and lists who may sell its space. sellers.json is published by ad platforms and lists the accounts they sell for. Buyers compare the two to confirm that a seller is genuine.
Where do I put the ads.txt file?
Place it at the root of your domain so it loads at yourdomain.com/ads.txt. A file in a subfolder is not found by crawlers. Test it in a browser and make sure it shows plain text without redirects.
Do I still need ads.txt if I only use AdSense?
It is strongly advised. Google's help pages recommend adding it, and a missing file may limit which buyers bid on your inventory. It takes minutes to add. Copy the exact line from your AdSense account.
What happens if my ads.txt is wrong?
Buyers may not trust requests that claim to come from your site, so some bids drop or disappear and revenue falls. Ad dashboards often show a warning. Fix the file, clear any caching, and wait for crawlers to refresh.
Sources2
- support.google.com/adsense/answer/12171612
- iabtechlab.com/ads-txt
Links open the original pages. Spotted an error? Tell us and we will check it.