MonetizeMyWebsite
Display Ad Monetization

ads.txt: What It Is and How to Set It Up

Learn ads.txt how to set up, where to upload the file, and how to verify authorized digital sellers on your domain.

BK· 8 min read

If you want the direct answer, ads.txt is a plain text file that lives at the root of your domain and lists your authorized digital sellers. In practice, ads.txt how to works like this: get the exact seller lines from each ad partner, put them into a file named ads.txt, upload it so it loads at yourdomain.com/ads.txt, and verify it publicly. If you run display ads through AdSense, Ezoic, Monumetric, Mediavine, Raptive, or direct SSP relationships, this is part of basic setup alongside your broader display ad revenue strategy.

Website admin workflow showing a plain text ads.txt file uploaded to a domain root directory and checked in a browser at /ads.txt

ads.txt: what it is and why it matters

ads.txt stands for Authorized Digital Sellers. It is a plain text file publishers place on their domain to tell buyers which companies are allowed to sell their ad inventory. The goal is simple: reduce unauthorized reselling and domain spoofing in programmatic advertising.

What authorized digital sellers means

Authorized digital sellers are the ad exchanges, SSPs, and monetization partners you have approved to sell ads on your site. When you add an entry to your ads.txt file, you are effectively saying, “this platform is allowed to represent my inventory.” That matters whether you monetize directly with Google AdSense or through managed setups like Ezoic, Monumetric, Mediavine, or Raptive.

Why advertisers and SSPs check ads.txt

Buyers and platforms crawl the file at https://yourdomain.com/ads.txt to confirm authorization before bidding. This does not guarantee higher earnings by itself, and RPMs always vary by niche, geography, and season, but it can help buyers trust your inventory and reduce revenue leakage caused by unauthorized sellers. As of 2026, approximately, most serious programmatic demand sources expect publishers to have ads.txt configured correctly.

How ads.txt works

The mechanics are straightforward. Each partner gives you one or more line items to add. Ad buyers fetch your ads.txt file, compare those entries against seller data in the auction, and use that to validate who is allowed to sell your inventory.

The 4 fields in an ads.txt line

A standard ads.txt line usually has four parts: the ad system domain, your publisher account ID, the relationship type, and an optional certification authority ID. A typical example looks like this: google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0.

  • Ad system domain: the platform selling inventory, such as google.com.
  • Publisher account ID: your account identifier with that platform.
  • Relationship type: usually DIRECT or RESELLER.
  • Certification authority ID: an optional identifier many major platforms include.

DIRECT vs RESELLER

DIRECT means you control the account relationship with that exchange or system directly. RESELLER means another company is authorized to resell your inventory through its own relationship. In real-world setups, managed ad networks often require multiple entries, and some of those will be RESELLER lines. That is normal if the network instructs you to add them.

The key point is not to guess. Ad platforms usually provide the exact lines you should use, and those values need to match exactly.

ads.txt how to set it up step by step

Step 1: Get your ads.txt lines from each ad network

Collect the required entries from every ad partner you actively use before you edit anything. That may include AdSense, your header bidding partner, your managed ad network, or any direct SSP relationship. As of 2026, approximately, large managed networks like Mediavine and Raptive typically provide onboarding documentation or dashboard instructions with the exact lines required.

Step 2: Create the ads.txt file correctly

Create or edit a plain text file named ads.txt. Use a plain text editor, not a word processor. Add each partner on its own line exactly as provided. Do not add bullets, smart quotes, formatting, or comments unless the network specifically allows them.

Step 3: Upload ads.txt to the root domain

Upload the file to the root directory of your main domain so it resolves at /ads.txt. That means https://yourdomain.com/ads.txt should load directly. Not /folder/ads.txt, not a hidden admin URL, and not a private file viewer. If your site runs on WordPress, your hosting file manager, SFTP, CDN edge rules, or a dedicated plugin can all work, but the final result must still be a public root-level file.

Step 4: Verify the file is live

Open yourdomain.com/ads.txt in a browser and confirm the file loads publicly without redirects, login prompts, formatting issues, or server errors. Then check your ad platform dashboard for any ads.txt warnings. Some platforms take time to recrawl, so a warning may persist briefly even after the file is fixed.

Example ads.txt file format

Here is a simple example structure. These are format examples only. Use the exact values your own partners provide.

Example lineWhat it represents
google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0A typical Google AdSense-style entry
example-ssp.com, 12345, DIRECTA direct SSP relationship
example-exchange.com, 67890, RESELLER, abcdef1234567890A reseller authorized through another platform

Sample ads.txt entries

Most publishers will see at least one line from Google if they use AdSense or Google demand indirectly, plus additional lines from managed ad partners. If you are working with Ezoic, Monumetric, Mediavine, or Raptive, expect them to tell you exactly what to add rather than relying on a generic one-line template.

How to avoid formatting mistakes

  • Keep each seller entry on its own line.
  • Do not change commas, spacing, account IDs, or relationship labels.
  • Use plain text only.
  • Do not paste from a document that adds hidden formatting.
  • If multiple partners provide entries, merge them into one ads.txt file instead of replacing the whole file each time.

Common ads.txt setup mistakes

Root-domain and subdomain confusion

One of the most common mistakes is uploading the file somewhere other than the root domain. If your site resolves on non-www, check non-www. If it resolves on www, check www. The practical test is simple: the version buyers crawl must return a valid public ads.txt file at the domain root. Putting it on a subdirectory or forgetting how your canonical domain is configured causes a lot of false “missing ads.txt” warnings.

Formatting and syntax errors

  • Using rich text instead of plain text.
  • Typing the file name incorrectly.
  • Changing commas or adding extra spaces in critical fields.
  • Using the wrong account ID.
  • Replacing old entries without merging required ones from other partners.
  • Letting a plugin, CDN, or deployment process overwrite the file.

How to maintain your ads.txt file over time

When to update ads.txt

Update your ads.txt file whenever you add, remove, or change ad networks. Also recheck it after site migrations, CDN changes, domain canonicalization changes, or platform moves. If your monetization stack changes, your ads.txt file often needs to change with it.

How often to audit authorized sellers

I would audit it whenever you make a monetization change and then do a quick manual check periodically. The goal is not to create busywork. It is to keep one clean source of truth that is not being overwritten by multiple tools or team members. If you no longer work with a seller, remove stale lines after the partner confirms they are no longer required.

What I’d actually do if I were setting up ads.txt today

I would start with the exact lines from current partners only, publish one clean ads.txt file, verify it manually at /ads.txt, and then review platform dashboards after they have time to recrawl. If I were using a managed network, I would follow its documentation first because those setups often require more than a basic AdSense line. And if I were still deciding between ad stacks, I’d make that decision before overengineering the file. Your bigger monetization fit still matters more than the text file itself.

If you need help evaluating whether AdSense is the right starting point before you deal with a larger ad stack, read the Google AdSense guide next.

What is an ads.txt file?
An ads.txt file is a plain text file placed at the root of your domain that lists the ad systems authorized to sell your inventory. It is used by buyers to verify authorized digital sellers and reduce unauthorized reselling or spoofing.
Where do I upload my ads.txt file?
Upload it to the root of your main domain so it is publicly accessible at yourdomain.com/ads.txt. It should not live in a subfolder or behind a login. The exact upload method depends on your host, CMS, or CDN.
How long does it take for ads.txt changes to be recognized?
Usually it depends on when ad platforms recrawl your domain. Sometimes changes are recognized within hours, but it can also take a day or several days. If the file is correct and publicly reachable, temporary warnings often clear after the next crawl.

Get the next guide by email

One practical email when we publish.

Keep reading