Skip to content
Approvalens

Free · no sign-up

ads.txt Generator for AdSense

Type your publisher ID, paste the lines your other ad networks gave you and download a clean ads.txt. Switch to Check to paste an existing file and see every broken line. Nothing you type leaves your browser.

Build or check an ads.txt file

What do you want to do?

In AdSense: Account, Settings, Account information. Any form works: ca-pub-…, pub-… or the 16 digits.

Paste them exactly as the network sent them, one per line.

The business domain that owns the site. Part of ads.txt 1.1; most small sites can leave it out.

An email address or URL where buyers can reach you about this file.

Enter your publisher ID or paste some lines, and the file appears here.

What goes into the file

For AdSense alone the whole file is one line: google.com, your publisher ID, DIRECT, and Google's certification authority ID, f08c47fec0942fa0. The generator writes it from whatever form of the ID you paste: ca-pub-…, pub-… or just the 16 digits.

Other networks (Ezoic, Media.net, the SSPs behind a header bidding setup) send you their own lines. Paste them as they are. Valid records are kept once, in your order, and anything broken is left out with the line number, so you can ask the network for a corrected copy.

Where to upload it

The file has to open at the root of the domain you added in AdSense: https://example.com/ads.txt. A copy in a folder (/blog/ads.txt) isn't read, and Google's crawl rules say a file on www.example.com/ads.txt is only crawled if example.com/ads.txt redirects to it.

  • WordPress: upload it to the folder that holds wp-config.php, or use one ads.txt plugin, not both.
  • Blogger: Settings, Monetization, turn on Enable custom ads.txt, then paste the file into Custom ads.txt.
  • Netlify, Vercel, Cloudflare Pages and other static hosts: the folder published as the site root, often public/ or static/.
  • Site builders: some have an ads.txt field in the dashboard; check our platform guides for Wix, Shopify and Squarespace.

Mistakes the Check tab catches

  • ca-pub- instead of pub- in the google.com line
  • A publisher ID with the wrong number of digits
  • A certification ID other than f08c47fec0942fa0 on a google.com line, or none at all
  • Fewer than three fields, or a relationship other than DIRECT or RESELLER
  • Curly quotes, non-breaking spaces and bullets that came along from a document or a chat app
  • HTML in the file, which usually means the server sent a page instead of the text file
  • The same record twice, and your own publisher ID missing or listed only as RESELLER

After you upload it

Open the file in a private window. You should see bare text, not your theme around it. Then run the ads.txt checker on the live site: it fetches the file the way a crawler does, checks the status code and Content-Type, and compares the ID with the AdSense code on your home page.

Don't expect AdSense to notice within minutes. Google's help says it "may take a few days" to crawl and verify the file, and up to a month for a site that makes few ad requests. Editing the file again and again doesn't speed that up.

Questions

Frequently asked questions

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

No. Google describes ads.txt as not mandatory but highly recommended. Once a file exists, though, it has to list your publisher ID, or AdSense rejects the site's ad requests.

What is f08c47fec0942fa0?

Google's certification authority ID. It's the same for every AdSense publisher and it's the fourth field of the line AdSense gives you, so keep it.

Should my AdSense line say DIRECT or RESELLER?

DIRECT. You control the AdSense account that sells your ad space. RESELLER lines come from companies that sell your space through their own accounts.

Can one ads.txt hold several ad networks?

Yes. One file per domain holds every network's lines. Paste each network's lines exactly as they give them; the generator removes duplicates and broken lines.

Does this tool send my publisher ID anywhere?

No. The file is built in your browser. Only the separate ads.txt checker fetches anything, and only the public file on your site.

Guides

Guides that use this tool

Where this check comes up, and how to fix what it finds.

Next step

One check here, the whole site in the report

This is one of 258 checks. Scan the whole site for the full picture; the first 50 pages are free.

First 50 pages free · no sign-up · no card