Quick fix: AdSense marks ads.txt "Not found" when its crawler did not get a plain-text file with HTTP 200 at /ads.txt on your root domain. On a Cloudflare site the usual culprits are a missing apex-to-www redirect, a cached old 404 or HTML page, or a bot challenge. Run this against your bare domain over plain HTTP; it follows every redirect:
curl -sL -o /dev/null -w '%{http_code} | %{content_type} | redirects=%{num_redirects} | final=%{url_effective}\n' http://example.com/ads.txt
You want 200 | text/plain and a final URL on your own domain. Anything else points to one of the causes below. After fixing it, open Sites in AdSense, click the site and click Check for updates.
The exact error
On the AdSense Sites page, the ads.txt status column shows Not found, which Google's help defines as:
Not found
No ads.txt file was found when the AdSense crawler last crawled this site.
Your AdSense homepage may also show an alert with a Fix now button. Google's help pages call it only "an alert in your AdSense account" and do not print its text. Publishers usually report it as starting with Earnings at risk, followed by a line asking them to fix ads.txt issues, but the banner wording may vary, so treat the Sites page status as the reliable signal. Google's guide sends you to the same alert and Fix now button for the other ads.txt problem, a file without your publisher ID:
Unauthorized
All ad requests from this site are being rejected because your publisher ID was not found in this site's ads.txt file. To prevent any impact to your revenue, add your publisher ID to the ads.txt file.
If your status is Unauthorized, the file is reachable: just add the line AdSense gives you.
Why it happens
Google's crawler requests /ads.txt on your root domain over both HTTP and HTTPS. The rules, from AdSense help and the IAB ads.txt spec it links to:
- "Ads.txt crawling will start at the root domain, and the root domain needs to return from, or redirect to, the ads.txt file." A file only on
www.example.com/ads.txtis crawled "only if domain.com/ads.txt redirects to it." - The response needs "the HTTP 200 OK status code". A 404 means "The previous entries will be purged." A soft 404 (a real page returned with status 200) or a 500 keeps old entries "for up to 5 days".
- The IAB spec, which Google says your file must follow, says the Content-Type "should be 'text/plain', and all other Content-types should be treated as an error and the content ignored."
- Multiple redirects are fine as long as each stays within your root domain. Google allows "a single HTTP redirect to a destination outside the original root domain".
Find your cause
| Cause | How to recognise it | Fix |
|---|---|---|
| File only on www, apex does not redirect | http://example.com/ads.txt returns 404 or your homepage; www works | Redirect the apex to www (or serve the file on both) |
| Only one of HTTP or HTTPS works | One scheme returns 404, 403 or a connection error | Turn on Always Use HTTPS, or serve both |
| Redirect chain leaves your domain more than once | redirects= shows hops through two other domains | One hop off-domain at most |
| Cloudflare serves a cached old response | cf-cache-status: HIT with old content or a 404 | Purge the URL; bypass cache for /ads.txt |
| Bot Fight Mode, WAF or Under Attack challenge | cf-mitigated: challenge, HTML instead of text; events in Security Analytics | Skip rule for /ads.txt; Bot Fight Mode cannot be skipped, so turn it off |
| CMS serves an HTML page | 200 | text/html, body starts with <!DOCTYPE html> | Upload a real file or fix the plugin; serve text/plain |
| robots.txt blocks it | Disallow: /ads for all agents, or Disallow: / for Googlebot | Allow /ads.txt |
| Fixed recently, not re-crawled | All checks pass, status still Not found | Check for updates; wait a few days, up to a month |
Cause 1: the file is on www and the apex does not redirect
If your site lives on www.example.com, Google needs example.com/ads.txt to redirect there. On Cloudflare, create a Single Redirect rule from the Rules Overview page; Cloudflare requires the apex DNS record to be proxied for it to run. Cloudflare's own "Redirect from root to WWW" example matches only https://example.com/* and sends it to https://www.example.com/${1} with a 301, so turn on Always Use HTTPS too, or plain HTTP requests to the apex are left alone. Here is a healthy chain from a large public site, apex over HTTP to www over HTTPS, all within one root domain (headers trimmed):
$ curl -sIL http://theguardian.com/ads.txt | grep -iE '^(HTTP|location|content-type)'
HTTP/1.1 301
Location: https://theguardian.com/ads.txt
HTTP/2 301
location: https://www.theguardian.com/ads.txt
HTTP/2 200
content-type: text/plain; charset=UTF-8
Cause 2: only HTTP or only HTTPS works
Google says the crawler "attempts to crawl ads.txt files on both HTTP and HTTPS", and an HTTPS 404 purges the entry even if HTTP works. On Cloudflare, Always Use HTTPS "redirects all your visitor requests from http to https", which satisfies this with a redirect inside your domain. Check both schemes:
curl -s -o /dev/null -w '%{http_code}\n' http://example.com/ads.txt
curl -s -o /dev/null -w '%{http_code}\n' https://example.com/ads.txt
A 301 to HTTPS then a 200 is fine; so is 200 on both.
Cause 3: the redirect leaves your domain twice
Redirecting /ads.txt to a file on another domain is allowed once. If that location redirects again, the IAB spec treats it as an error. Point the redirect straight at the final URL.
Cause 4: Cloudflare is serving an old cached response
Cloudflare does not cache .txt files by default: its default list covers extensions such as CSS, JS and images, plus robots.txt. It does cache ads.txt once a Cache Rule makes it "Eligible for cache" (a "cache everything" rule, for example). Without cache headers from your server, Cloudflare then keeps a 200 for 120 minutes and a 404 for 3 minutes, and a Cache Rule with a longer Edge TTL keeps it longer. Look at the header:
curl -sI https://example.com/ads.txt | grep -iE '^(HTTP|content-type|cf-cache-status|age)'
DYNAMIC or BYPASS means the response came from your server. HIT with an age header means Cloudflare served a stored copy. To fix: in Caching > Configuration, use Custom Purge and purge the exact URL for each host and scheme, then add a Cache Rule for URI path equals /ads.txt with Bypass cache.
Cause 5: Bot Fight Mode, the WAF or Under Attack mode challenges the crawler
Cloudflare says Bot Fight Mode "Identifies traffic matching patterns of known bots" and issues challenges. A challenge returns an HTML page, with the header cf-mitigated: challenge, instead of your text file. Open Security > Analytics > Events and filter on the path /ads.txt: challenged requests show the service that acted, such as Bot Fight Mode.
- WAF custom rules, managed rules and Super Bot Fight Mode: add a custom rule with expression
(http.request.uri.path eq "/ads.txt")and action Skip. - Bot Fight Mode (Free plan): Cloudflare states "you cannot skip Bot Fight Mode", and that Skip, Bypass and Allow actions in WAF rules or Page Rules have no effect on it. If it challenges
/ads.txt, turn it off under Security > Settings (filter Bot traffic), or move to Super Bot Fight Mode (Pro, Business and Enterprise plans), which supports skip rules. - Under Attack mode: every visitor gets an interstitial challenge page while it is on, so switch it off once the attack is over.
Do not test with a fake Googlebot user agent from your laptop: Cloudflare can tell it is not Google, so the result proves nothing. Google does not name the user agent that fetches ads.txt; its robots.txt examples use Googlebot, and AdSense's own crawler is Mediapartners-Google.
Cause 6: the CMS answers with an HTML page
When no real file exists, many CMSs and single-page app hosts answer /ads.txt with their 404 template, often with status 200. That is the soft 404 Google warns about, and an HTML content type breaks the IAB rule. A deactivated ads.txt plugin on WordPress has the same effect. Here is what it looks like, reproduced with a local test server (port closed afterwards):
$ curl -s -o /dev/null -w "%{http_code} %{content_type}\n" http://127.0.0.1:8765/ads.txt
200 text/html; charset=utf-8
$ curl -s http://127.0.0.1:8765/ads.txt | head -c 60
<!DOCTYPE html><html><head><title>Page not found</title></he
Upload a plain-text ads.txt to the web root (or public/ in most frameworks), or re-enable the plugin, and confirm the response is text/plain. Google recommends a plain text editor, because rich text editors can add hidden characters. A cached HTML 404 looks like HTTP/2 404, content-type: text/html, cf-cache-status: HIT, which is what a Cloudflare-hosted docs site without an ads.txt returned in our test.
Cause 7: robots.txt blocks the crawler
Google's two blocking examples: User-agent: * with Disallow: /ads (which matches /ads.txt), and User-agent: Googlebot with Disallow: /. Fix it with Disallow: /ads/ or an explicit Allow: /ads.txt. Check the robots.txt actually served:
curl -s https://example.com/robots.txt
Cause 8: the fix is right but AdSense has not re-crawled
Google says: "It may take a few days for your changes to be reflected in AdSense. If your site doesn't make many ad requests it may take up to a month." Use Sites > your site > Check for updates to ask for a recheck. Do not remove a correct file while waiting: Google notes that "Any changes made to your ads.txt file will affect the review time."
Check it is fixed
Run these against your own bare domain:
# 1. Status, type and redirects from the crawler's starting point
curl -sL -o /dev/null -w '%{http_code} | %{content_type} | redirects=%{num_redirects} | final=%{url_effective}\n' http://example.com/ads.txt
# 2. Same over HTTPS
curl -sL -o /dev/null -w '%{http_code} | %{content_type} | redirects=%{num_redirects} | final=%{url_effective}\n' https://example.com/ads.txt
# 3. Cache and challenge headers at the final URL
curl -sI https://example.com/ads.txt | grep -iE '^(HTTP|content-type|cf-cache-status|cf-mitigated)'
# 4. First line of the body
curl -sL http://example.com/ads.txt | head -3
A healthy Cloudflare-proxied file (this site's own, checked 17 November 2026, publisher ID replaced; checks 1, 3 and 4):
200 | text/plain; charset=UTF-8; charset=UTF-8 | redirects=0 | final=http://kxdevelopers.com/ads.txt
HTTP/2 200
content-type: text/plain; charset=UTF-8; charset=UTF-8
cf-cache-status: DYNAMIC
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
Then click Check for updates in AdSense. You are done when the status reads Authorized: "Your publisher ID was found in this site's ads.txt file. No action is required."
Related errors
Unauthorized: the file is found but your publisher ID is not in it, and "All ad requests from this site are being rejected". Add the line from AdSense.Not applicable: "Your publisher ID isn't needed in this site's ads.txt file because the ads.txt file is managed by a platform." No action needed.
What to do next
- Still setting up Cloudflare? Read what Cloudflare is and how to set it up without breaking email.
- Hosting a static site? Deploy a website for free on Cloudflare Pages, GitHub Pages, Vercel or Netlify covers where files like
ads.txtgo. - Check what crawlers see on your pages with the free Open Graph checker.
- Official docs: Ensure your ads.txt files can be crawled, Ads.txt guide, Ads.txt FAQs and Cloudflare's Default cache behavior.
FAQ
How long does AdSense take to find a new ads.txt file?
A few days, says Google, and up to a month for sites with few ad requests. Use Check for updates on the Sites page to ask for a recheck.
Does AdSense follow redirects for ads.txt?
Yes: multiple redirects within your root domain (HTTP to HTTPS, apex to www), plus a single redirect to another domain.
Does Cloudflare cache ads.txt?
Not by default, because .txt is not in Cloudflare's default cached extensions (only robots.txt is). It does when a Cache Rule makes it eligible for cache, so check cf-cache-status.
Why does ads.txt open in my browser but AdSense says Not found?
Your browser may show a cached copy, may be on www while the crawler starts at the apex, or may have passed a challenge the crawler cannot. Test with curl from the bare domain.
How this fix was verified
AdSense is a hosted Google product, so the warning itself could not be reproduced, and we did not sign in to AdSense or Cloudflare. Status texts come from Google's AdSense help pages; Google does not publish the alert's wording, so we do not quote it. Crawl rules come from the AdSense help pages and the IAB ads.txt 1.0.2 specification that Google links to. Cloudflare behaviour comes from Cloudflare's developer docs. All were fetched on 17 November 2026.
Run here (macOS 26.5 on Apple M4, curl 8.7.1): the curl checks above against public sites (this site, theguardian.com, nytimes.com and others), including the redirect chain and the cached HTML 404, and the soft-404 example on a local Python server bound to 127.0.0.1, which we stopped and confirmed its port was free. Docs only: the Cloudflare dashboard steps, Bot Fight Mode and WAF behaviour, caching TTLs, and AdSense's crawl timing.
Last verified: 17 November 2026.
We re-check this fix monthly and record any change in this page's changelog.
Comments 0
No comments yet. Be the first to share your thoughts.
Leave a comment