TMOD LogoTMOD

ads.txt checker

Checks that /ads.txt exists, contains valid records, and authorizes google.com.

What TMOD checks

  • Fetches /ads.txt from your domain root and confirms it returns HTTP 200 with a non-empty body.
  • Rejects the common failure where a missing file is served as an HTML 404 page with a 200 status, we check the first 200 bytes for an <html> or <!doctype> marker and treat that as absent.
  • Parses the body line by line, stripping everything after a # comment, and counts a line as a valid record only if it has at least three comma-separated fields.
  • Looks for a record authorizing google.com with a publisher ID, matching a google.com field followed by a pub- prefixed number.

Why it matters

ads.txt is how you tell the advertising ecosystem which companies are allowed to sell inventory on your domain. Without it, anyone can claim to represent your site in a programmatic auction, and buyers have no way to verify the claim. That fraud is the problem the standard exists to solve.

For a site applying to AdSense, ads.txt is not a requirement for approval, you do not need one to be accepted, and its absence is a warning here rather than a failure. It becomes important the moment you are approved: without the correct google.com line, Google will report that your inventory is unauthorized and your ads can stop serving.

The most common real-world failure is not a missing file but a broken one. A file served from the wrong path, a file with smart quotes pasted in from a document, or a file where every line lost its commas parses to zero valid records, which is functionally identical to having no file at all while looking fine in a browser.

How to fix it

01Put the file at the domain root

It must be served at https://yourdomain.com/ads.txt exactly. Not in a subdirectory, not on a subdomain, not behind a redirect chain. Subdomains need their own file if they serve ads independently.

02Use the exact record format

Each line is: domain, publisher ID, relationship, certification authority ID. For AdSense the line is `google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0` with your own publisher ID substituted. That last field is Google's certification authority ID and is the same for everyone.

03Serve it as plain text

Content-Type should be text/plain. Some CMSs will happily serve a page at that path wrapped in a full HTML template, which no parser accepts. Fetch it with curl rather than a browser to see what is actually returned.

04Add the line only once you have a publisher ID

Before approval you do not have one, and there is nothing useful to put in the file. This check reports its absence as a warning precisely because it is not something to fix before applying.

Where the file sits in the advertising supply chain

ads.txt is one half of a pair. You publish it to declare which companies may sell inventory on your domain. The ad platforms publish sellers.json to declare which publishers they represent. A buyer reads both, follows the supply chain attached to the bid, and confirms that the path from your domain to the seller offering the impression is one both ends agree on. Where the two do not agree, the bid is dropped.

This is why the states are asymmetric in a way that surprises people. No file at all leaves your inventory unverified, which most buyers still tolerate. A file that exists but omits a partner you genuinely work with actively blocks that partner, because you have now made a positive declaration and they are not in it. The second state is the one that costs money, and it is usually reached by adding a second network and forgetting the file.

It is checked in the technical audit for the same reason as robots.txt and the sitemap: a plain text file at a fixed path that any machine can read and that quietly stops working when nobody is watching it. Search engines do not read it and it has no bearing on rankings.

After approval, when the file starts to matter

Once you are serving ads, the failure announces itself in your AdSense account rather than on your site. The wording is an earnings-at-risk or unauthorized-inventory notice, and it means Google fetched your file and did not find a line naming itself with your publisher ID. Pages keep loading, the ads simply stop filling.

Changes are not instant. Crawlers re-fetch the file on their own schedule, so allow a day or two after an edit before deciding it did not work, and confirm the new file is actually being served rather than a cached copy from a CDN that still has the old one.

Keep it current when your setup changes. Adding a network means adding its line, leaving one means removing it, and working through an ad management partner usually means their lines rather than yours, with your own DIRECT line kept alongside. An old line for a company you no longer work with is not dangerous, it is just an authorisation you have left standing for no reason.

Questions

Do I need ads.txt to get approved for AdSense?

No. Approval does not depend on it, which is why this check reports a missing file as a warning rather than a failure. It matters after approval: once you have a publisher ID, the google.com line is what authorizes Google to sell your inventory, and without it you will see unauthorized-inventory warnings in your AdSense account and reduced or halted ad serving.

What does DIRECT mean, and when would I use RESELLER?

DIRECT means you have a direct contractual relationship with that advertising system, which is the case for AdSense, since you contract with Google. RESELLER means the named company is authorized to resell your inventory on your behalf, which applies when you work through an ad management partner. If you only run AdSense, every line you need is DIRECT.

My ads.txt is there but the checker says it has no valid records.

That means the file returned content but no line survived parsing. Each record needs at least three comma-separated fields after comments are stripped. The usual causes are a file pasted from a word processor where commas or quotes were auto-formatted into different characters, a file where every entry ended up on one line, or a file that is actually an HTML error page.

Does having ads.txt help my SEO?

No. It has no effect on search rankings whatsoever, it is an advertising supply-chain file that only ad buyers read. It appears in this technical audit because it is machine-checkable from the outside and matters to the same people, not because search engines care about it.

This check runs inside the technical SEO audit

Checking one thing costs the same as checking everything, the crawl is the expensive part, not the checks.

Open it