ads.txt Explained: Fixing the "Earnings at Risk" Warning
What the ads.txt file does, the exact one line AdSense needs, where to place it, and why the warning takes a day or two to clear.
If you logged into your AdSense dashboard and saw a red or yellow banner shouting “Earnings at risk — you need to fix ads.txt file issues to avoid severe impact to your revenue,” take a breath. This is one of the most common warnings publishers panic over, and it is almost always trivial to fix. It does not mean you did anything wrong. Your account is not in trouble, and your ads have not stopped. It means Google could not find a small text file on your site that it wants to see. This guide explains exactly what that file is, why Google nags you about it, and how to create and place it correctly the first time.
What ads.txt actually is
The name stands for Authorized Digital Sellers. It is an anti-fraud standard created by the IAB Tech Lab, the advertising industry’s technical standards body. The problem it solves is domain spoofing: bad actors selling fake ad inventory while pretending to be your website, siphoning off advertiser money that should never have been in play. An ads.txt file is your public declaration of who is allowed to sell ads on your domain.
Think of it as a guest list posted on the front door. When an advertiser’s system considers buying an ad slot that claims to be from yoursite.com, it checks your ads.txt file to confirm that the seller offering that slot is genuinely authorized by you. If your Google publisher ID is on the list, the bid proceeds. If your file is missing, some buyers get cautious and bid less, which is precisely the “risk to earnings” Google is warning you about.
The exact one-line format for AdSense
For a standard AdSense-only publisher, your entire ads.txt file is a single line. Here it is:
google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
Every field matters, and each is separated by a comma and a space. Here is what each part means:
- google.com. The domain of the advertising system that is authorized to sell your inventory. For AdSense this is always
google.com, lowercase. - pub-XXXXXXXXXXXXXXXX. Your unique publisher ID. Replace the X’s with your own number. You can find it in AdSense under Account then Settings then Account information, or in your original AdSense code snippet where it appears as
ca-pub-XXXXXXXXXXXXXXXX. In theads.txtline you drop theca-prefix and keeppub-followed by your 16 digits. - DIRECT. This declares that you have a direct business relationship with Google, as opposed to
RESELLER, which would mean a third party sells on your behalf. For plain AdSense it is alwaysDIRECT. - f08c47fec0942fa0. This is Google’s Certification Authority ID. It is the same fixed value for every AdSense publisher on the planet. Copy it exactly. Do not invent or alter it.
Getting your publisher ID right is the single most important step. A wrong digit means the file exists but does not authorize you, so Google keeps warning you as if it were missing.
Where the file must live
Placement is where most people trip up. The rules are strict and non-negotiable:
- Root of your domain. The file must be reachable at
https://yoursite.com/ads.txt, directly off the root, not inside a folder. If it sits at/blog/ads.txtor/files/ads.txt, crawlers will never look there and it does not count. - Plain text, named exactly. The filename is
ads.txt, all lowercase, with a genuine.txtextension. It must be served as plain text, not as an HTML page dressed up to look like text. - Publicly accessible. Open an incognito window and visit
yoursite.com/ads.txtyourself. You should see your single line and nothing more, with no login wall, redirect, or 404 blocking the way.
On most hosts you upload the file to the same directory that contains your homepage’s index file (often public_html or www). On WordPress, a plugin can inject it for you, or you can drop it in the root via FTP. On platforms like Blogger, there is usually a dedicated ads.txt setting in the admin panel. Use that rather than fighting the templating system. You can confirm it resolves correctly with our link checker before you tell Google to look again.
Why the warning appears, and how long the fix takes
The banner appears for one reason: Google’s crawler visited yoursite.com/ads.txt and either got a 404, got redirected somewhere unexpected, or found a file that does not contain a valid, authorized line for your publisher ID. It is a heads-up, not a penalty. Your ads keep serving while the warning is up; you may simply be leaving some money on the table because certain premium buyers discount unauthorized inventory.
Once you upload a correct file, you do not need to do anything else. Google re-crawls ads.txt files automatically. Be patient, though: it commonly takes 24 to 48 hours, and Google officially says it can take up to a few days for the warning to clear. Do not upload the file, refresh the dashboard ten minutes later, and assume it failed. Verify the file is live and publicly readable, then wait a day.
Common mistakes that keep the warning alive
- Wrong publisher ID. A transposed digit or the leftover
ca-prefix invalidates the whole line. Copy your ID straight from AdSense. - File in a subfolder. It must be at the root.
/wp-content/ads.txtdoes nothing. - HTML instead of plain text. Some site builders wrap everything in a page template, so your “file” is actually an HTML document. Crawlers reject it.
- Blocked by a redirect. Aggressive HTTPS or www redirects sometimes bounce
/ads.txtto your homepage. Make sure it returns the raw text with a 200 status. - Subdomain confusion. If your content lives on
blog.yoursite.com, the file needs to be on that exact subdomain’s root, not only the bare domain. - Extra invisible characters. Pasting from a rich-text editor can add hidden formatting. Write the line in a plain editor like Notepad.
One thing to keep in perspective
The ads.txt file is optional but strongly recommended, and it is completely separate from whether AdSense approves your site. You will never be rejected during review for lacking one, and having a perfect file will not rescue an application that fails on content policy grounds. If you are still working toward that green light, our approval guide is the better use of your time. The ads.txt warning is purely a revenue-optimization nudge for accounts that are already live.
So fix it, but do not let it dominate your worries. Add the one line, place it at your domain root, confirm it loads in a private browser window, and wait a couple of days. If you want a second set of eyes on your setup (ads.txt, policy pages, and general monetization health), run your site through our AdSense audit and address whatever it flags.
Run the audit on your own site
See, in fifteen seconds, which of the issues described here apply to your site — and which you’ve already cleared.
Run free auditMore guides
View all →Reapplying for AdSense After Rejection: A Recovery Plan
Rejected for low value content? A calm, concrete cycle: diagnose the reason, fix the substance, wait for the re-crawl, then resubmit once.
Images for AdSense: Copyright-Safe Sources (and Why Text-Only Posts Fail)
Why text-only posts read as thin, the copyright trap of Google Images, and where to get relevant, safe visuals with proper alt text.
How to Get Real Traffic Before You Apply for AdSense
AdSense has no traffic minimum, but real human visitors help. White-hat channels — search, Pinterest and social — without ever buying traffic.