ads.txt Explained: The Tiny File That Controls Whether You Get Paid
A Text File Worth Thousands of Dollars
Somewhere on your web server, there's (or should be) a tiny text file called ads.txt. It's usually less than 1KB. It contains a few lines of cryptic text that look like someone sneezed on their keyboard. And it's one of the most important files on your entire website, because it determines whether advertisers trust your ad inventory enough to bid on it.
If your ads.txt is missing, malformed, or out of date, you're almost certainly losing revenue. Advertisers won't bid on inventory they can't verify. And if you're applying to a new ad network without a proper ads.txt, some networks will reject your application outright. Let me explain what this file does and how to get it right.
What ads.txt Actually Does
The problem ads.txt solves is ad fraud. Before ads.txt existed, anyone could claim to sell your ad inventory. A bad actor could set up a system that says "I have ad space on bigfamouswebsite.com, bid on it" — and advertisers would have no way to verify whether that was true. They could end up paying for ads that never appeared on the claimed site. This is called domain spoofing, and it cost advertisers billions of dollars annually.
Ads.txt (Authorized Digital Sellers) is a simple solution. You put a text file at yoursite.com/ads.txt that lists every company authorized to sell your ad inventory. When an advertiser sees a bid request claiming to come from your site, they check your ads.txt to verify the seller is listed. If the seller isn't in your file, the advertiser rejects the bid. Fraud eliminated, at least for that vector.
The format is straightforward. Each line contains a domain (the ad exchange), a publisher account ID, the relationship type (DIRECT or RESELLER), and optionally a certification authority ID. Here's what a real entry looks like:
google.com, pub-1234567890, DIRECT, f08c47fec0942fa0
That line says: "Google (via the google.com exchange) is authorized to directly sell ad inventory on this site, using publisher account pub-1234567890, and this is certified by the TAG (Trustworthy Accountability Group) certification authority."
Why Missing ads.txt Costs You Money
If you don't have an ads.txt file at all, some demand sources will still bid on your inventory — but many premium advertisers won't. Google estimates that publishers without ads.txt lose 10-25% of potential revenue because brand-safety-conscious advertisers refuse to bid on unverified inventory. When a major brand like Nike or Apple is buying ads, their agencies specifically filter for ads.txt-verified inventory. If you're not in that pool, those high-CPM bids never reach your site.
The impact is invisible because you never see the bids you didn't get. You just see a slightly lower RPM and think that's normal. It's not — you're being excluded from premium auction demand because advertisers can't verify your legitimacy. Fix the file and watch your RPM improve, sometimes significantly.
How to Set Up ads.txt
The good news: if you use a premium ad network like Mediavine, Raptive, or Ezoic, they provide you with the correct ads.txt content. Check your network dashboard for a section called "ads.txt" or "Setup" — they will give you the exact lines to include. Copy those lines into a plain text file, name it ads.txt, and upload it to your site's root directory so it's accessible at yourdomain.com/ads.txt.
If you use WordPress, there are plugins (like the Ads.txt Manager plugin) that let you manage the file from your dashboard without FTP access. If you use a static site or custom CMS, you'll need to create the file manually and ensure your server serves it correctly.
For AdSense users specifically: your ads.txt needs at least this line:
google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
Replace the pub-XXX with your actual AdSense publisher ID. You can find it in your AdSense dashboard under Account > Account Information.
Common ads.txt Mistakes
Stale entries from old networks: If you switched from AdSense to Mediavine but still have AdSense entries in your ads.txt, that's fine — old entries don't hurt. But if you switched networks and forgot to add the new network's entries, your new network's ads can't be verified. Always add before you remove.
Typos in publisher IDs: A single wrong character in your publisher ID means that entry is invalid. Advertisers checking that entry will see a mismatch and refuse to bid. Copy-paste directly from your network dashboard — never type these IDs manually.
Wrong file location: The file must be at the root of your domain: yourdomain.com/ads.txt. Not yourdomain.com/blog/ads.txt, not a subdirectory, not behind a redirect. Crawlers expect it at the exact root path.
HTML instead of plain text: Your server must serve ads.txt as plain text (Content-Type: text/plain), not as an HTML page. If you created the file through a CMS that wraps it in HTML tags, crawlers can't parse it correctly. Test by visiting yourdomain.com/ads.txt in your browser — you should see raw text, not a formatted webpage.
Encoding issues: The file should be UTF-8 encoded with no BOM (byte order mark). Some text editors on Windows add a BOM by default, which can break parser compatibility. Use a code editor like VS Code to create the file and ensure UTF-8 encoding.
Checking Your ads.txt
An AdGateScore scan automatically checks your ads.txt as part of the Policy Compliance module. It verifies the file exists, is accessible, is properly formatted, and contains valid entries. If there are issues, the scan tells you exactly what is wrong and how to fix it. Google also provides an ads.txt validator in the AdSense dashboard if you want a second opinion.
Beyond ads.txt: sellers.json and app-ads.txt
The ads.txt ecosystem has expanded. Sellers.json is the demand-side complement — it lets advertisers verify the identity of companies selling ad inventory. You don't need to create a sellers.json file (that's your network's responsibility), but knowing it exists helps you understand the verification chain.
App-ads.txt is the mobile app equivalent. If you have a mobile app with ads, you need app-ads.txt in addition to ads.txt. The format is identical, but the file serves a different inventory type.
The key takeaway: ads.txt isn't optional. It takes five minutes to set up correctly, it costs nothing, and it directly impacts your revenue. If you haven't checked yours recently, do it now. Visit yourdomain.com/ads.txt and verify it contains current entries for every network you work with. That five-minute check could be the easiest RPM improvement you ever make.