If your AdSense dashboard is flashing “Earnings at risk — You need to fix some ads.txt file issues to avoid severe impact to your revenue,” don’t panic — this is a five-minute fix. Adding an ads.txt file in WordPress takes one plugin and one copy-paste, or a single file upload to your hosting root. Here’s the short answer: install the Ads.txt Manager plugin, paste the exact line AdSense gives you (it looks like google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0, with your own publisher ID), save, and verify it loads at yourdomain.com/ads.txt. Google re-checks within 24–48 hours and the warning clears itself.
What ads.txt actually is (and why AdSense nags you about it)
Ads.txt stands for Authorized Digital Sellers. It’s a tiny plain-text file that sits at the root of your site and publicly declares which advertising companies are allowed to sell your ad inventory. Google introduced the standard to fight counterfeit ad inventory — buyers pretending to sell ad space on your site.
Here’s the part that costs you money: Google has stated that domains hosting an ads.txt file that doesn’t list the seller’s publisher ID will no longer be monetized through Ad Manager, and Google won’t buy ads on such sites. That’s what the “Earnings at risk” warning is telling you. Google’s own ads.txt guide says the file isn’t strictly mandatory, but it’s highly recommended because it protects you from counterfeit inventory and can help you earn more.
If you’re still working toward AdSense eligibility itself, read our guide on Google AdSense approval requirements for 2026 first — ads.txt comes into play once your site is approved and serving ads.
Get your exact ads.txt line from AdSense first
Never type the line from memory. Get the exact version from your account:
- Sign in to your Google AdSense dashboard.
- Click the “Fix now” button on the “Earnings at risk” warning — it takes you to your site’s ads.txt management page.
- AdSense shows you the exact line (or a download button for a ready-made file). It looks like this:
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0 - Replace the zeros with your real publisher ID (found in AdSense under Account → Account Information). Note the format: the ID appears as
pub-followed by 16 digits — noca-prefix.
If you work with other ad networks (Mediavine, Raptive, Ezoic, Media.net), each publishes its own required lines. Grab all of them fresh from each network’s dashboard — these lists change as networks add partners, so don’t reuse an old block from a blog post.
Method 1: Use the Ads.txt Manager plugin (easiest)
This is the fastest method and the one I’d recommend for most WordPress sites:
- In your WordPress dashboard, go to Plugins → Add New and search for “Ads.txt Manager.” Install and activate it.
- Go to Settings → Ads.txt (the exact settings location is under the Settings menu).
- Paste your ads.txt line(s) into the text area — one per line.
- Click Save Changes.
The plugin serves your file virtually at yourdomain.com/ads.txt — no actual file needed on the server. The plugin’s official WordPress.org page has the latest version details and support forum if anything behaves oddly. One caveat: because it’s served dynamically, make sure your caching plugin doesn’t interfere. After saving, clear your site cache (in LiteSpeed Cache, that’s LiteSpeed Cache → Purge → Purge All) and check the URL in an incognito window so you’re seeing the live file, not a cached page.
Method 2: Upload the file manually to your site root (no plugin)
If you’d rather not add another plugin, the manual method is just as simple:
- Open Notepad (Windows) or TextEdit (Mac, in plain-text mode) and paste your ads.txt line(s).
- Save the file as
ads.txt— lowercase, exactly. NotAds.txt, notads.txt.txt. - Log in to your hosting cPanel → File Manager (or connect via FTP/FileZilla).
- Open the
public_htmlfolder — that’s your site’s root directory. If your WordPress is installed in a subdomain or subdirectory, use that folder instead. - Upload the file directly into that root folder — not into
wp-content,wp-admin, or any subfolder. A 404 on your ads.txt URL almost always means the file landed in the wrong folder. - Confirm it appears in the root listing.
A note on file managers inside WordPress (like “WP File Manager” plugins): they work, but uploading to the root this way gives you the same result with a bit more clicking. Use whichever you’re comfortable with — the outcome is identical.
Verify it worked (don’t skip this)
Never assume it worked. Confirm it two ways:
1. Load it in a browser. Go to yourdomain.com/ads.txt directly. You should see your line(s) as plain text. If you get a 404, the file is in the wrong folder — re-upload it to the root.
2. Wait for AdSense to re-check. Once the file loads correctly, the “Earnings at risk” warning clears on Google’s own schedule, usually within 24–48 hours. You cannot force this — there’s no “re-check now” button worth chasing. If the warning lingers past 48 hours, re-read your line character by character. A mistyped pub- number is the single most common reason a correct-looking file still fails.
Common ads.txt mistakes in WordPress
- Wrong folder. The file must live at the root, not in
wp-contentor a theme folder.yourdomain.com/ads.txtmust return plain text — any other path is wrong. - Typo in the publisher ID. One wrong digit and the file is useless to Google. Copy-paste from AdSense, don’t retype.
- Missing lines for other networks. If you run Mediavine or Raptive alongside AdSense, each needs its own entries. Check every network’s dashboard.
- Caching showing a stale page. LiteSpeed and other cache plugins can serve a cached version of the URL. Purge all cache and check in incognito.
- Capitalization. The filename must be lowercase
ads.txt. Web servers on Linux treatAds.txtandads.txtas different files. - Redirects. Make sure
http://tohttps://redirects andwwwhandling still serve the file. Load both versions of the URL once to be safe.
Related: Setting Up AdSense Rewarded Ads With Reader Revenue (2026)
Frequently Asked Questions
What happens if I don’t add an ads.txt file in WordPress?
Google says ads.txt isn’t mandatory, but domains whose ads.txt file is missing their publisher ID can be cut off from Ad Manager monetization — and Google won’t buy ads on those sites. In practice, the “Earnings at risk” warning means you’re leaving revenue exposed, so fix it.
What is the exact format of the AdSense ads.txt line?
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0 — with the zeros replaced by your own publisher ID. The four parts are: the ad system domain (google.com), your publisher ID (without the ca- prefix), the relationship type (DIRECT means you own the account directly), and Google’s certification authority ID (fixed for all AdSense publishers).
How long does AdSense take to verify ads.txt?
Usually 24–48 hours after the file is live and loading correctly at yourdomain.com/ads.txt. The warning clears automatically — you can’t force a re-check.
Where is ads.txt in WordPress root?
In your hosting file manager, it’s the public_html folder (the directory that contains wp-admin, wp-content, and wp-includes). The file must sit directly there so it resolves at yourdomain.com/ads.txt.
Can I use a plugin instead of uploading manually?
Yes — the Ads.txt Manager plugin serves the file virtually from Settings → Ads.txt with no server upload needed. Just remember to purge your cache plugin afterwards so the live file shows up.
Do I need separate ads.txt lines for other ad networks?
Yes. Each network (Mediavine, Raptive, Ezoic, Media.net, etc.) publishes its own required entries. Add every network’s lines to the same file, one per line, copied fresh from each dashboard.
