Ad operations

How to Set Up ads.txt and Fix Common Errors

A plain-English guide to ads.txt: what each line means, where the file goes, how to add partner lines, and how to fix the warnings that cost publishers revenue.

MH AdX guide graphic explaining the ads.txt file and how to fix common errors

ads.txt is a plain text file at the root of your domain that lists every company allowed to sell your ad inventory. Programmatic buyers check it before they bid. If your file is missing, can't be reached or leaves out a partner, part of your demand skips your site.

Here's the catch: nothing on your site looks broken when this happens. Pages load, ads still show, and revenue just drifts down while one SSP quietly stops bidding. A short file that's reachable and copied exactly from your partners fixes most of it, and it's the first building block of any website monetization setup.

What ads.txt is and why buyers check it

ads.txt (Authorized Digital Sellers) is a public list of who may sell ads on your domain, and buyers use it to skip sellers you didn't authorise. The standard comes from the IAB Tech Lab.

ads.txt exists to stop domain spoofing, where someone sells fake impressions under a well-known site's name. Buying platforms crawl your file, then compare the seller in each bid request with your list. No match, no bid from most of them.

For you, that plays out in three ways:

  • A correct file lets every partner you work with sell your inventory without friction.
  • A missing or incomplete file means some demand won't bid, which pulls down fill and CPMs (our guide to AdSense CPM and RPM shows how those numbers connect).
  • A file full of old partners is harder to audit, and new partners will ask why those sellers are still there.

ads.txt format: how to read each line

Each authorised seller gets one line with up to four comma-separated fields: ad system domain, your account ID, the relationship, and an optional certification ID.

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
FieldExampleWhat it means
Ad system domaingoogle.comThe domain of the platform that sells the inventory.
Seller account IDpub-0000000000000000Your account ID on that platform. It must match exactly, including the pub- prefix where one is used.
RelationshipDIRECT or RESELLERDIRECT when you control the account. RESELLER when another company sells on your behalf through its own account.
Certification ID (optional)f08c47fec0942fa0The platform's TAG ID. Your partner tells you whether to include it.

Lines starting with # are comments. The spec also allows a few variables: CONTACT= for a contact address, SUBDOMAIN= to point crawlers to a subdomain's own file, and OWNERDOMAIN= and MANAGERDOMAIN=, which say who owns the site and who manages its inventory.

Those last two arrived with version 1.1 of the standard in August 2022. OWNERDOMAIN is your own business domain, and the spec recommends it. MANAGERDOMAIN is optional and names a primary or exclusive monetization partner, so add it only when a partner manages your inventory and asks you to. A full file looks like this:

# ads.txt for example.com
OWNERDOMAIN=example.com
CONTACT=adops@example.com
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
exampleexchange.com, 12345, RESELLER

Most people get one thing wrong here. RESELLER isn't a bad label. It just says someone else's account sells your ads, and a partner who sells through its own exchange account should give you RESELLER lines. Marking them DIRECT to look better makes the line wrong, not stronger.

Rule of thumb: never write or tweak a line yourself. Copy each one exactly as your ad partner sends it, then confirm it with them.

Where the file must live

The file must open at the root of your domain, straight after the domain name. Crawlers don't look anywhere else.

  • Correct: https://example.com/ads.txt
  • Wrong: a copy inside a subfolder such as /blog/, or a file saved with a double .txt extension

The file should return a normal 200 response with plain text. Open it in a private browser window. You want the raw lines, not your homepage, a login screen or a styled 404 page. If your site uses www, check that address too. Keep redirects to a minimum and avoid chains.

A faster test from a terminal: curl -I https://example.com/ads.txt. Look for 200 on the first line and content-type: text/plain further down. A 403 or a text/html type means something between the crawler and the file needs fixing.

Say your WordPress site lives in a folder like example.com/site/. The file still goes at the domain root, not inside that folder. The domain root is what counts, not where WordPress sits.

For a subdomain such as news.example.com, crawlers start from the root domain. Either keep all lines in the root file, or add subdomain=news.example.com to the root file and put a separate file at the subdomain's root.

How buyers crawl the file, and when a partner can host it

Ad systems fetch your file, cache it and re-check it on a schedule, and the IAB rules decide what counts as valid. The ads.txt 1.1 specification spells out each case, and these are the ones that matter to you:

What the crawler findsWhat the spec says it does
A 200 response with text/plainReads the lines and uses them
A 404Assumes you've made no declarations
Any other error, such as a timeout or a 5xxKeeps using the last copy it fetched successfully
Another content type, such as text/htmlTreats the response as an error and ignores the content
Both HTTP and HTTPS versionsPrefers the HTTPS data
No cache or expiry headersTreats its copy as fresh for 7 days by default

That 7-day default explains a lot of "I fixed it but nothing changed" questions. A buyer that fetched your broken file yesterday can keep using that copy for a week.

Can an ad partner host ads.txt for you?

Yes, through a redirect. The spec allows any number of redirects inside your own root domain, plus a single redirect to a location outside it. So example.com/ads.txt can redirect to a file your monetization partner keeps up to date for you.

There's one hard limit. If the partner's location redirects again, the spec tells crawlers to treat it as an error. Before you hand the file over, open your ads.txt address and check it lands on plain text after one hop. And make sure you can still add lines for partners outside that relationship, or you'll be asking someone else every time you add an SSP.

How to create ads.txt step by step

You build the file once from your partners' exact lines, upload it to your domain root and give crawlers time to find it. Six steps cover it.

  1. List every partner that sells your inventory. Include your own accounts (Google Ad Manager or AdSense, for example) and every network, SSP or monetization partner you use.
  2. Collect the exact lines from each partner. They're in the partner's dashboard or onboarding email. Header bidding partners send long lists, and that's normal.
  3. Create the ads.txt file as plain text in a basic editor like Notepad, or TextEdit in plain text mode. Word processors swap straight commas and quotes for "smart" characters that break parsing.
  4. Upload it to your site's root. On WordPress, use a plugin built for the file or upload the file to the folder that holds wp-admin and wp-content (when WordPress runs at the domain root). On other hosts, use the file manager or FTP and place it next to your homepage file.
  5. Check the live file in a browser and with your partner's validation tool.
  6. Wait for crawlers. Platforms re-crawl on their own schedule. Status changes can take several days, so don't keep editing the file while you wait.

Our advice: one person owns the file. When a developer, an agency and a partner all edit it, lines go missing.

How to fix common ads.txt errors

Almost every error has one of three causes: the file can't be reached, a line is missing, or a line has a typo. Google's AdSense guide to the file shows the exact line for your publisher ID, and the Sites page in AdSense shows each site's file status.

"Earnings at risk" or "ads.txt not found"

AdSense shows the "Earnings at risk" alert when it can't find your file or your own line is missing. Check that the file loads at the root as plain text, and that your publisher ID appears with DIRECT. Changed hosting, CDN or SSL settings recently? Test from a private window and a phone on mobile data. A firewall or bot-protection rule can block crawlers while the file still opens for you.

The file is found but a seller is still "unauthorized"

This points to a typo in the account ID, a missing partner line or the wrong relationship field. Compare your lines character by character with what the partner sent. Say you added a new SSP last month and it's barely bidding. The first thing we'd check is whether all of its lines made it into the live file, because partners that resell through several exchanges need one line for each.

The file shows your homepage instead of text

Some site builders and caching plugins send unknown paths to the homepage. Add the file through the platform's own setting for it, or ask your host to serve it as a static file with a text/plain content type.

Old partners are still listed

Remove lines for partners you no longer work with. A long list of inactive sellers makes audits slower and muddies who really represents you.

Revenue from one partner drops after a site change

Look at revenue by demand partner, not just the total. When one SSP falls off a cliff the week you moved hosts, added a CDN or switched themes, open the live file before anything else. A rule that serves crawlers a challenge page, or a theme that redirects unknown paths, breaks the file without breaking the site.

ads.txt, sellers.json and supply chains

Your file is one half of a pair, and buyers check both halves. The other half is sellers.json, a file each ad platform publishes listing the sellers it works with. Our sellers.json guide for publishers walks through every field and how to check your own entry.

The seller ID in your file should appear in that platform's sellers.json with a seller_type of PUBLISHER, INTERMEDIARY or BOTH. As a rough guide, your DIRECT lines should map to an entry that names you or your company, and RESELLER lines to the partner that sells on your behalf. You can check it yourself: open the partner's sellers.json (ask them for the link if you can't find it) and search for your ID or domain. When the two files match, a buyer can trace an impression from your page to the company that sold it. That's the trust clean setups earn.

app-ads.txt for apps and CTV

Mobile and connected TV apps use the same idea through app-ads.txt, hosted on the developer website in your app store listing. It never goes inside the app.

Many CTV platforms follow the same approach. If you're planning CTV monetization or app monetization, make sure your store listings point to a website you control before launch. For the line format, the crawler rules and a fix for each AdMob status, see our guide to setting up the file for apps and fixing AdMob errors. Our guide to how streaming apps earn from CTV ads shows where it fits in a full connected TV setup, and our Roku channel monetization guide covers the Roku side.

Frequently asked questions

Is ads.txt required?

ads.txt isn't a law, but most programmatic buyers expect it and many won't bid on a domain without a matching line. AdSense and Ad Manager also warn you when the file is missing. Every site that sells ads programmatically should have one.

How long do changes take to show?

Each platform crawls on its own schedule, so updates take anywhere from a day to about a week to appear. Check that the live file is correct, then wait instead of editing it again.

Do I need a separate file for each subdomain?

No. You can keep all lines in the root domain file, or point to a subdomain with a subdomain= line and host a separate file there.

Does the file help SEO?

Search engines don't use the file as a ranking signal. Ad buyers and ad platforms read it, and its job is protecting your ad revenue, not your rankings.

Is ads.txt only for Google?

No. ads.txt is an open IAB Tech Lab standard, and every programmatic platform reads the same file. Google's line is one entry among many, so each SSP, exchange and network you work with needs its own lines.

What if my site doesn't sell ads at all?

You don't need a file to stay safe, but the spec offers a way to say "nobody is authorized". Empty files are deprecated, so it suggests one placeholder record: placeholder.example.com, placeholder, DIRECT, placeholder.

How often do buyers check ads.txt?

Each ad system sets its own crawl schedule. The spec tells them to honour your server's expiry headers and, when there are none, to treat a cached copy as fresh for 7 days. Plan for up to a week before every buyer sees a change.

A quick checklist

Run these six checks after every partner change and after any hosting, CDN or plugin change.

  • The file opens at the root of your domain as plain text.
  • Your own account line is there with the correct ID and relationship.
  • Every active partner's lines are copied exactly as sent.
  • Inactive partners are gone.
  • Subdomains and apps are covered where you monetize them.
  • The file still loads from a private window after any site change.

Keep it short, keep it reachable, and copy every line as sent. That's most of the job. It's also one of the first things we open in a website and account readiness review. If you're preparing for Google AdX through a partner, our guide on how to get Google AdX access explains where this file fits in that process.

Free tools

Is your site ready for Google AdX?

Check your AdX eligibility

Our current screening asks for $1,000 or more in two separate months of the last three, and invalid traffic under 10%.

Free AdX readiness checklist (PDF)

The 25 checks we run before recommending a site for AdX through MCM. Enter your details and download it straight away.

We will only use your email to reply about your site.

WhatsApp