HTTP & Indexing Warning 4 min read

How to Fix Google AdSense "ads.txt Not Found" Warnings

Direct Technical Answer

Google AdSense flags 'ads.txt not found' when https://yourdomain.com/ads.txt returns 404, redirects to /login behind auth middleware, sits only on a www subdomain, or serves an HTML error page instead of plain text publisher records.

Why Does This Issue Occur? (Symptom & Cause Matrix)

Observed SymptomRoot Technical CauseRecommended Fix
ads.txt redirects to /login (307)App authentication middleware intercepts /ads.txtWhitelist /ads.txt in middleware.ts to serve HTTP 200 text/plain
File uploaded inside /blog instead of rootWrong directory pathServe strictly at root https://yourdomain.com/ads.txt (public/ads.txt)

Step-by-Step Fix Checklist

  1. 1

    Place ads.txt in Webroot / public/ Directory

    Create public/ads.txt (Next.js) or webroot /ads.txt (Hostinger/WordPress) containing: google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0.

  2. 2

    Bypass Auth Middleware & Bot Challenges

    Ensure auth middleware and Cloudflare WAF return raw HTTP 200 text/plain without login redirects.

  3. 3

    Verify Live via curl -i

    Confirm Content-Type: text/plain and exact publisher ID output before clicking Verify in AdSense.

Exact Google AdSense ads.txt Record Format

google.com, pub-4109344249041101, DIRECT, f08c47fec0942fa0

People Also Ask About This Error

How long does AdSense take to recognize a newly added ads.txt?

Once /ads.txt returns HTTP 200 text/plain publicly, clicking Verify triggers re-crawling within minutes to 24 hours.

Should robots.txt disallow ads.txt?

Never—disallow rules block Google's Mediapartners-Google and AdSense verification bots from reading ads.txt.

More Search Console & Performance Fix Guides

24/7 Autonomous Technical SEO Engine

Stop auditing spreadsheets. Let ApexSEO ship fixes 24/7.

Connect your domain via Hostinger FTP, GitHub, or our 1KB cookieless telemetry beacon to automate PageRank internal linking, AI FAQPage schema, and live Google SERP tracking up to 12,000 pages.