Home › Blog › Setup & Optimization
Setup & Optimization

Ads.txt Explained: The Small File That Protects Your Ad Revenue

Buyers read your ads.txt file before they bid. One missing line can switch off demand without any warning. Here is how to get it right and keep it right.

A developer's screen showing an ads.txt file with DIRECT and RESELLER lines next to an Advorex Media panel marked Verified

Before an advertiser buys an ad on your website, their buying platform checks one small text file: yourdomain.com/ads.txt. If the company trying to sell your ad space is listed there, the bid goes ahead. If it is not, many buyers simply walk away, without an error message, without an email, without anything in your dashboard except lower numbers.

That makes ads.txt one of the most important files on a monetized website, and also one of the most neglected. This guide explains what it does, how to write it correctly and how to keep it from silently costing you money.

What ads.txt is and why it exists

Ads.txt stands for Authorized Digital Sellers. It is a public list, published by you, of every company allowed to sell your ad inventory. It was introduced by the IAB Tech Lab to fight a simple but expensive fraud: criminals pretending to sell ad space on well-known websites, taking advertisers' money and showing the ads somewhere else entirely.

Because only you can place a file on your own domain, ads.txt gives buyers a reliable way to check that a seller really represents you. Most large buyers now treat a missing or incomplete ads.txt as a reason not to bid.

The format, line by line

Each line in ads.txt describes one authorized seller account and has three required fields and one optional field, separated by commas:

exampleadnetwork.com, pub-1234567890, DIRECT, f08c47fec0942fa0
another-exchange.com, 55501, RESELLER
FieldMeaning
1. DomainThe domain of the advertising system, for example the ad network or exchange.
2. Account IDYour publisher account ID inside that system. It must match exactly.
3. RelationshipDIRECT if you control the account yourself; RESELLER if a partner sells your inventory through their own account.
4. Certification ID (optional)An ID from a certification authority such as the Trustworthy Accountability Group (TAG), identifying the advertising system.

Lines that start with # are comments and are ignored. Blank lines are fine.

DIRECT or RESELLER?

This is the field publishers get wrong most often. Ask one question: whose account is it?

  • If you signed up with the network yourself and the ID is your own account, use DIRECT.
  • If a mediation platform or agency sells your inventory through their account with that network, use RESELLER, exactly as they tell you.

Mislabeling a line can make buyers treat the path as unauthorized. Copy the lines your partners give you exactly as provided.

How to create ads.txt, step by step

  1. Collect the lines. Every ad network and mediation platform you use provides the lines you need. Gather them all in one place.
  2. Create a plain text file named exactly ads.txt, in lowercase. Use a plain text editor, not a word processor.
  3. Paste one seller per line. Keep the order of the fields and the commas exactly as given.
  4. Upload it to the root of your domain, so it opens at https://yourdomain.com/ads.txt. On WordPress, a plugin or your host's file manager can place it there.
  5. Open the URL in a browser and check that the file loads as plain text with no login page, no redirect loop and no HTML around it.
  6. Check both versions of your domain. If readers can reach your site at both www and the bare domain, make sure ads.txt is reachable for the domain your ad tags declare.

The most common ads.txt errors

ProblemWhat happensFix
File missing or in a subfolderBuyers find nothing and many stop biddingPlace it at the domain root
A partner's lines are missingThat partner's demand drops without warningAdd every line each partner gives you
Wrong account IDThe line does not match the seller, so it counts as unauthorizedCopy IDs exactly; do not retype them
DIRECT and RESELLER swappedBuyers may reject the pathUse the relationship your partner specifies
File served as HTML or behind a loginCrawlers cannot read itServe it as plain text, publicly
Old lines never removedNot harmful by itself, but hides real problemsReview the file whenever partners change
Tip: treat ads.txt like a contract listEvery time you add or remove an ad partner, update ads.txt the same day. Most revenue drops blamed on "a bad month" in the first weeks with a new partner are simply missing ads.txt lines.

What about sellers.json?

Ads.txt is your side of the check. sellers.json is the ad system's side: a public file where each network lists the sellers in its system. Buyers compare both files to confirm that the path from your site to the ad is legitimate. You do not publish sellers.json yourself, but it is one more reason to use the exact account IDs your partners give you.

Keeping ads.txt current without manual edits

When you work with a mediation platform, the list of demand partners can change as new networks are added. Editing the file by hand every time is easy to forget. Two common solutions:

  • A plugin that pulls the lines for you, if your site runs on WordPress.
  • A hosted ads.txt with a redirect. Your platform keeps an always-current file, and your own /ads.txt redirects to it. The specification permits this, so buyers follow it normally.

How to check your ads.txt is working

  • Open https://yourdomain.com/ads.txt in a private browser window.
  • Confirm every partner's lines are present and match the IDs in your partner dashboards.
  • Watch your fill rate for the following week. A healthy, complete ads.txt usually shows up as steadier fill.

How Advorex Media helps

Every approved site in your Advorex Media dashboard shows the exact ads.txt lines it needs, ready to copy, along with a hosted ads.txt address you can redirect to so the list stays current as demand partners change. Ads.txt is also part of the site checklist you see while setting up, alongside your ad units and code. For the bigger picture of how buyers judge traffic quality, read our guide to invalid traffic.

Key takeaways

  • Ads.txt lists who is allowed to sell your ads; buyers check it before bidding.
  • Each line is domain, account ID, DIRECT or RESELLER, and an optional certification ID.
  • Missing lines, wrong IDs and files in the wrong place are the most common and most costly mistakes.
  • Update ads.txt the same day your partners change, or use a hosted file that updates itself.

Frequently asked questions

Where exactly does ads.txt go?

At the root of your domain, so it opens at https://yourdomain.com/ads.txt. A file in a subfolder is not read by buyers.

How long until ads.txt changes take effect?

Buyers re-crawl ads.txt on their own schedule, commonly within a day or two. Changes are not instant, so update the file before you start sending traffic through a new partner.

Can I redirect ads.txt to a file hosted elsewhere?

Yes. The ads.txt specification allows a redirect, as long as it stays within the same domain or goes to the domain that manages your ads.txt. Many publishers use a hosted file so partner lines stay current automatically.

Do I need app-ads.txt?

Only if you publish mobile apps. app-ads.txt is the equivalent file for apps and lives on the developer website listed in the app store.

Turn these tips into revenue

Advorex Media puts several ad networks in competition for every impression on your site, with one lightweight tag and a dashboard that shows the real numbers.

Create your free account →