As professional web developers based in Siliguri, West Bengal, and Delhi, at Website Stylers, we've helped hundreds of local businesses, startups, hotels, restaurants, real estate agencies, and educational institutions across India get approved for Google AdSense and resolve common monetization issues. One of the most frequent problems we encounter – especially with sites built on WordPress, Laravel (like many of our clients use with Filament and Livewire), Blogger, or custom platforms – is the dreaded "Earnings at risk – You need to fix some ads.txt issues to avoid severe impact to your revenue" warning.
This warning has been around for years, but in 2025, Google is stricter than ever about ads.txt compliance because of ongoing efforts to combat ad fraud, domain spoofing, and unauthorized inventory sales. If you're seeing this alert (even if your site was approved years ago with just 10-15 posts), it doesn't mean your AdSense account is banned – it simply means Google can't fully verify that you're the authorized seller of your ad inventory. Without a correct ads.txt file, advertisers pay less for your traffic, directly reducing your RPM and earnings by 20-50% in many cases we've seen.
The good news? Fixing this takes less than 10 minutes in most cases, and the warning usually disappears within 24-72 hours (sometimes up to 7 days if your site has low traffic). In this ultimate 2025 guide, we'll walk you through every possible method to create and manage your ads.txt file – tailored for different platforms, including non-WordPress sites like Laravel. We'll also cover advanced tips, common mistakes that keep the error persisting, and how to future-proof your setup so this never happens again.
What is ads.txt and Why Does Google Care So Much in 2025?
Ads.txt stands for Authorized Digital Sellers. It's a simple text file created by the IAB Tech Lab in 2017 and fully enforced by Google AdSense since 2019. The file sits at your domain root (e.g., https://yoursite.com/ads.txt) and publicly declares which companies (like Google AdSense) are allowed to sell ads on your site.
Why the "earnings at risk" warning triggers:
Missing ads.txt file entirely
Wrong or missing publisher ID (pub-XXXXXXXXXXXXXXX)
File not accessible on both www and non-www versions
HTTP vs HTTPS redirect issues
File in the wrong location (not root domain)
Multiple ad networks but incomplete entries
Cached or outdated file after domain changes
In 2025, with the rise of programmatic advertising and AI-driven fraud, Google scans ads.txt more aggressively. Even old approved sites can suddenly show this if Google re-crawls and finds discrepancies. We've fixed this for clients in Siliguri running tea export sites, Delhi NCR e-commerce stores, Darjeeling hotels, and Kalimpong handicraft shops – the fix is universal.
Where to Find Your Exact AdSense ads.txt Code in 2025
Log in to your Google AdSense account
If you see the red/orange warning banner, click "Fix it now" or "Learn more"
You'll be taken to the Sites section or a direct help page
Scroll down – Google now often provides a ready-to-copy line like this:
text
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0Replace the placeholder pub-0000000000000000 with your real publisher ID if needed
Your publisher ID is always found under Account > Account information – it's the 16-digit number starting with "pub-"
Copy this exact line – that's all most sites need if you only use AdSense.
Method 1: WordPress Sites (The Easiest – 2 Minutes)
Over 70% of our clients use WordPress. Here's the foolproof way:
Log into your WordPress dashboard
Go to Plugins > Add New
Search for "Ads.txt Manager" (the official one by 10up – free and trusted by Google)
Install and Activate it
Now go to Settings > Ads.txt
Paste your AdSense line into the editor
If you use other networks (Adsterra, Ezoic, etc.), add their lines on new rows
Click Save Changes
That's it! The plugin automatically creates /ads.txt at your root.
Alternative free plugins that work great in 2025:
Ad Inserter (has built-in ads.txt tab)
Advanced Ads
Rank Math SEO (Pro version has ads.txt manager)
Test: Visit https://yoursite.com/ads.txt – you should see your code plainly.
Method 2: For Laravel / Filament / Livewire Sites (No WordPress)
Many of our own client projects (and Website Stylers' portfolio) run on Laravel. Here's how we implement ads.txt without plugins:
Option A – Quick Route (Recommended for 2025):
Add this to routes/web.php:
PHP
Route::get('/ads.txt', function () {
return response("google.com, pub-YOUR_PUBLISHER_ID_HERE, DIRECT, f08c47fec0942fa0")
->header('Content-Type', 'text/plain');
});Replace pub-YOUR_PUBLISHER_ID_HERE with your real ID.
Option B – Create Physical File:
Using File Manager or FTP, go to your Laravel public folder (/public)
Create a new file named ads.txt
Paste your AdSense line
Save
This works perfectly with Livewire 3 and Filament – we've deployed this on dozens of Siliguri and Delhi client sites.
Method 3: Hosting Control Panel / cPanel / DirectAdmin
If you're on shared hosting (Hostinger, Bluehost, SiteGround – very common in India):
Log into cPanel
Open File Manager
Navigate to public_html (root folder)
Click + File > name it "ads.txt"
Right-click > Edit > paste your code
Save
For subdomains: Create separate ads.txt in each subdomain's root.
Method 4: Cloudflare, Nginx, Apache Manual Fixes
If you use Cloudflare (very popular for Indian sites):
Go to Rules > Page Rules
Create a rule for yourdomain.com/ads.txt with Cache Level: Bypass
This ensures the file is always served fresh
For Nginx servers (common on VPS):
Add to your site config:
text
location = /ads.txt {
add_header Content-Type text/plain;
return 200 "google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0\n";
}Critical 2025 Checklist: Why Your Fix Might Not Work Immediately
Even after adding the file, the warning can persist. Here's what we've learned fixing 200+ sites:
Must be accessible at BOTH versions:
https://yoursite.com/ads.txt
https://www.yoursite.com/ads.txt (if you use www)
Fix: Set up permanent 301 redirects in .htaccess or Laravel middleware
HTTPS Only: Google ignores HTTP versions in 2025
No extra text: The file must be pure text – no HTML, no BOM characters
Root domain only: Not in /wp-content or subfolders
Multiple sites? Each domain/subdomain needs its own ads.txt
Using other ad networks? Add their lines too, e.g.:
text
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0 aads.com, 12345, RESELLERClear cache: Purge Cloudflare, LiteSpeed, or WP Rocket cache after changes
Wait time: Google re-crawls every 24-72 hours. Low-traffic sites can take 2-4 weeks!
How to Verify Your ads.txt is Working Perfectly
Use Google's official tool:
Check in AdSense > Sites > Look for green checkmarks
Search Google: site:yoursite.com/ads.txt
Advanced: app-ads.txt for Mobile Apps & PWA (2025 Bonus)
If you have a progressive web app or Android/iOS app monetized with AdMob/AdSense:
Create app-ads.txt in developer console and reference it.
Why This Matters for Businesses in Siliguri, Delhi, Darjeeling & Kalimpong
In our experience at Website Stylers, local businesses lose thousands monthly because of this simple file. A Darjeeling hotel client was earning ₹8,000/month – after fixing ads.txt, it jumped to ₹22,000. A Delhi real estate portal saw RPM double overnight.
Don't let this technical detail hurt your revenue. If you're still stuck (especially on Laravel/Filament setups), contact us – we offer free 15-minute consultations for ads.txt and full AdSense approval audits.
Fix it today, and watch your earnings recover!