ads.txt is one of the simplest files on your website, and one of the most important for ad revenue. It is a plain text file that tells advertisers which companies are authorized to sell your ad inventory. Without it, demand partners cannot verify your inventory as legitimate, and many will refuse to bid. The result: lower fill rates, lower CPMs, and less money.
Despite its simplicity, ads.txt is frequently misconfigured. Missing entries, incorrect publisher IDs, wrong relationship types, and formatting errors silently cost publishers thousands of dollars in lost demand every month. This guide covers everything you need to know: what ads.txt is, how it works, how to create and host it correctly, the most common mistakes, and how to keep it maintained as your ad stack evolves.
What Is ads.txt?
ads.txt stands for Authorized Digital Sellers. It is a standard created by the IAB Tech Lab in 2017 to combat a specific type of ad fraud called domain spoofing.
Domain spoofing works like this: a fraudster creates a fake ad exchange account claiming to represent your website. They sell fake impressions labeled as your inventory to advertisers. Advertisers think they are buying space on your site, but their ads actually appear on low-quality or non-existent sites. You get nothing. The fraudster keeps the money. Advertisers waste their budget.
ads.txt solves this by letting you publicly declare which companies are authorized to sell your inventory. When an advertiser's buying platform (DSP) sees an ad impression claiming to be from yourdomain.com, it checks yourdomain.com/ads.txt to verify that the seller is listed there. If the seller is not in your ads.txt, the DSP blocks the transaction.
Why ads.txt Matters for Your Revenue
Beyond fraud prevention, ads.txt directly affects your bottom line in three ways.
First, demand access. Most major DSPs (Google DV360, The Trade Desk, Amazon DSP, MediaMath) now require ads.txt verification before placing bids. If a demand partner is not listed in your ads.txt, their bids are blocked by the DSP even though the demand partner has the technical ability to serve ads on your site. This means missing ads.txt entries equal missing bids, which equals lower CPMs and lower revenue.
Second, bid confidence. When your ads.txt is complete and accurate, DSPs bid with higher confidence because they know the supply chain is legitimate. This translates to slightly higher bid prices. Studies show that verified inventory commands a 10-15% CPM premium over unverified inventory.
Third, Google compliance. Google AdSense and Google Ad Manager both require ads.txt. Without your correct Google publisher ID in the file, Google may limit ad serving on your site. This can manifest as reduced fill rate, lower CPMs, or warning messages in your dashboard.
ads.txt Format Explained
An ads.txt file is a plain text file with one entry per line. Each entry has four fields separated by commas:
ads.txt Entry Format
domain, publisher-account-ID, relationship-type, certification-authority-ID
Example: google.com, pub-1234567890, DIRECT, f08c47fec0942fa0
Field 1: Domain
The domain of the advertising system or SSP (supply-side platform). This is the company that sells your inventory to advertisers. Examples: google.com, openx.com, appnexus.com, rubiconproject.com, pubmatic.com.
Field 2: Publisher Account ID
Your unique account identifier within that advertising system. For Google, this is your pub-XXXXXXXXXXXXXXXX ID. For other SSPs, it is whatever account or seat ID they assign to you. This is the most error-prone field because every platform uses different ID formats.
Field 3: Relationship Type
Either DIRECT or RESELLER.
- DIRECT: You have a direct contractual relationship with this advertising system. You control the account and receive payment directly from them. Use this for your own AdSense account, your own Ad Manager account, or any SSP where you have signed up and have a publisher account.
- RESELLER: A third party (like your ad management platform) has the relationship with the advertising system and resells access to you. Use this when your monetization partner includes demand sources that you do not directly control. If you use WeForAds, for instance, some demand partners will be listed as RESELLER because WeForAds manages the relationship on your behalf.
Field 4: Certification Authority ID (Optional)
The TAG (Trustworthy Accountability Group) ID of the advertising system. This is optional but recommended. Google's TAG ID is f08c47fec0942fa0. Most SSPs have TAG IDs listed in the IAB's official registry. Including this field adds an extra layer of verification.
How to Create Your ads.txt File
Step 1: Collect Entries from All Your Ad Partners
Every ad network, SSP, and monetization platform you work with will provide ads.txt entries. Collect them from:
- Google AdSense: Log into AdSense, go to Account > Account Information. Your entry is: google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
- Google Ad Manager: Same publisher ID as AdSense if linked. Also add entries for any networks or bidders configured in your GAM account.
- Your monetization platform: Platforms like WeForAds provide a complete ads.txt file with all required entries for their demand partners. This is typically available in your dashboard or sent during onboarding.
- Individual SSPs: If you manage header bidding yourself, each SSP (Index Exchange, OpenX, PubMatic, etc.) provides ads.txt entries in their publisher portal or documentation.
Step 2: Create the File
Open a plain text editor (Notepad on Windows, TextEdit in plain text mode on Mac, or any code editor). Paste all your ads.txt entries, one per line. Save the file as ads.txt with UTF-8 encoding and no BOM (byte order mark).
A basic ads.txt file might look like this:
Sample ads.txt File
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
google.com, pub-9876543210987654, RESELLER, f08c47fec0942fa0
openx.com, 123456789, RESELLER, a698e2ec2f3b4c5d
appnexus.com, 9876, RESELLER, f5ab79cb980f11d1
pubmatic.com, 654321, RESELLER, 5d62403b186f2ace
rubiconproject.com, 12345, RESELLER, 0bfd66d529a55807
Step 3: Upload to Your Root Domain
The file must be accessible at https://yourdomain.com/ads.txt. Upload methods vary by platform:
WordPress: Upload via FTP/SFTP to your site's root directory (the same folder as wp-config.php). Alternatively, use a plugin like "Ads.txt Manager" by developer 10up, which lets you edit ads.txt from the WordPress admin panel.
Static sites / custom hosting: Place the file in your web root directory (usually public_html, www, or htdocs).
Subdomains: If your content is on a subdomain (blog.yourdomain.com), you need ads.txt on both the subdomain and the root domain. The root domain ads.txt can include a subdomain=blog.yourdomain.com directive to refer crawlers to the subdomain's file.
Step 4: Verify It Works
After uploading, verify by visiting https://yourdomain.com/ads.txt in your browser. You should see the plain text content of your file. Check that:
- The URL returns a 200 status code (not 301 redirect, 403 forbidden, or 404 not found)
- The content type is text/plain
- The file is served over HTTPS
- All entries are visible and properly formatted
Common ads.txt Mistakes
1. Wrong Publisher ID
This is the most damaging mistake. If your Google publisher ID is pub-1234567890123456 but you typed pub-1234567890123457 (one digit off), Google's crawler will not find a matching entry and may restrict ad serving on your site. Always copy publisher IDs directly from your account dashboards, never type them manually.
2. Missing Entries for Active Demand Partners
If you add a new header bidding partner but forget to add their ads.txt entries, DSPs will block their bids on your inventory. This is particularly common when switching monetization platforms. Your new platform may connect you to 15 demand partners, each requiring ads.txt entries. Missing even one means that partner cannot effectively bid.
3. DIRECT vs RESELLER Confusion
Using DIRECT when the relationship is actually RESELLER (or vice versa) can cause verification failures. The rule is simple: if you have a direct account with the SSP and control it yourself, use DIRECT. If a third party manages the relationship on your behalf, use RESELLER. When in doubt, use the entries exactly as your monetization partner provides them.
4. Formatting Errors
Hidden characters, incorrect line endings, BOM markers, or extra whitespace can cause parsing failures. Always use a plain text editor, not a word processor like Microsoft Word or Google Docs (which can add hidden formatting). Save with UTF-8 encoding without BOM.
5. Serving ads.txt Behind a Redirect
If yourdomain.com/ads.txt returns a 301 or 302 redirect instead of the actual file content, some crawlers may not follow the redirect. Ensure the file is served directly at the canonical URL with a 200 response code.
6. Not Updating After Changing Ad Partners
When you switch from one ad platform to another or add new demand partners, your ads.txt needs to be updated simultaneously. Running a new header bidding setup with an outdated ads.txt that only contains your old AdSense entry means all your new demand partners are effectively blocked. This is one of the most common reasons publishers see low revenue after migrating from AdSense. For more on this, see our AdSense migration guide.
How WeForAds Handles ads.txt
Managing ads.txt across 10-20+ demand partners is tedious. Each partner has different IDs, different TAG certificates, and entries change as the programmatic ecosystem evolves. WeForAds simplifies this completely.
When you add your site to WeForAds, the platform generates a complete ads.txt file containing all required entries for every demand partner in your header bidding configuration. The file is available in your WeForAds dashboard with a single copy button. You upload it once, and whenever we add or update demand partners, we notify you with an updated file.
This eliminates the most common ads.txt errors: missing entries, wrong IDs, and stale files. Your ads.txt stays current with your actual demand configuration, ensuring maximum bid eligibility and the highest possible fill rates.
ads.txt for Advanced Setups
Subdomains and Multiple Domains
If you run ads on subdomains, you have two options. First, you can place an ads.txt file on each subdomain. Second, you can use the subdomain= directive in your root domain's ads.txt to point crawlers to subdomain-specific files.
For publishers with multiple domains, each domain needs its own ads.txt file. There is no way to share a single ads.txt across domains. If all your domains use the same monetization setup, the files will be identical, but they must be hosted separately.
app-ads.txt for Mobile Apps
If you also monetize mobile apps, you need app-ads.txt. This is the same format as ads.txt but hosted on the developer website listed in your app store entry. It serves the same purpose: declaring authorized sellers for your in-app ad inventory.
sellers.json: The Other Side
While ads.txt is the publisher-side standard, sellers.json is the SSP-side standard. SSPs publish sellers.json files listing all their authorized publishers. Together, ads.txt and sellers.json create a transparent supply chain that advertisers can verify end-to-end. As a publisher, you do not need to create a sellers.json file, but understanding that it exists helps you appreciate why your ads.txt entries need to match exactly what your SSPs have on record.
Frequently Asked Questions
What is ads.txt and why do I need it?
ads.txt (Authorized Digital Sellers) is a text file hosted at your domain root that lists all companies authorized to sell your ad inventory. It was created by the IAB Tech Lab to combat ad fraud. Without it, most demand-side platforms will not bid on your inventory, significantly reducing your ad revenue and eCPMs.
Where do I put my ads.txt file?
Place it in your website's root directory so it is accessible at yourdomain.com/ads.txt. It must return a 200 status code with text/plain content type over HTTPS. On WordPress, upload to the same folder as wp-config.php or use an ads.txt manager plugin. On static hosting, place it in your web root (public_html, www, or htdocs).
What happens if my ads.txt file has errors?
Errors can prevent demand partners from bidding on your inventory. Wrong publisher IDs, incorrect relationship types, missing entries, and formatting issues can each reduce effective demand by 10-50%. This directly lowers CPMs and fill rates. Validate your file after every change and cross-reference entries with your actual ad partner accounts.
How often should I update my ads.txt file?
Update whenever you add or remove demand partners, change ad networks, or receive updated seller information from your monetization platform. Review quarterly at minimum. With a managed platform like WeForAds, you receive notification whenever updates are needed, keeping the file current with your actual demand configuration.
Does ads.txt affect my AdSense or Ad Manager revenue?
Yes. Google requires your correct publisher ID in ads.txt for both AdSense and Ad Manager. Without it, Google may limit ad serving, reducing fill rate and revenue. Google's crawler checks regularly, and discrepancies trigger dashboard warnings. An accurate ads.txt is essential for maintaining full Google demand access.
Tired of Managing ads.txt Manually?
WeForAds auto-generates your complete ads.txt file with all demand partner entries. One file, always current, zero guesswork.
Get Started Free
By