Fix Ads.txt Errors on WordPress for AdSense: Step-by-Step Guide.
ads.txt problem solving guide (for WordPress and AdSense).
Estimated reading time: 9 minutes
Thank you for reading this post, don't forget to subscribe!Ads.txt Problem Solving Guide for WordPress and AdSense
Ad fraud steals money from honest publishers, and it often slips in quietly. If you run ads on WordPress with AdSense, your first line of defense is a simple text file called ads.txt. It lists who is allowed to sell your ad space, so buyers can trust they are paying the right owner, you. When it is missing or wrong, fake sellers can slip in, and your revenue can drop.
Here is the simple idea. Ads.txt is a public list that lives at yoursite.com/ads.txt. It names authorized sellers in a standard format, including your AdSense publisher ID and Google’s certification ID. AdSense checks it, then warns you with an “Earnings at risk” alert if the file is missing, placed in the wrong spot, or has typos. That warning often means less demand, lower CPMs, and fewer served ads until you fix it.
WordPress users have it easier than most. You can add ads.txt with a plugin from your dashboard, or upload it to your site’s root folder once and keep it updated. The key is accuracy, clean formatting, and fast edits when you see alerts in AdSense. Get those right, and you protect your inventory, boost buyer confidence, and keep money from leaking out.
This guide shows you how to fix common ads.txt mistakes, stop the “at risk” notices, and confirm everything works on your WordPress site. Prefer a quick visual? Here is a helpful walkthrough.
Step-by-Step Guide to Creating and Adding Ads.txt to Your WordPress Site
Before you add anything, grab your AdSense publisher ID. It looks like pub-1234567890123456. You can find it in your AdSense account under Payments, then Account information. If you need help, follow Google’s guide on how to find your publisher ID. You will place that ID into this exact line for AdSense:
google.com, pub-ID, DIRECT, f08c47fec0942fa0
Replace pub-ID with your real publisher ID. Keep commas, spacing, and capitalization exactly as shown.
Manual Method: Upload Ads.txt Using FTP for Full Control
If you want total control and a lightweight setup, use FTP. It is precise and fast, but small mistakes can cause headaches. Follow these steps carefully.
- Create the file on your computer
- Open Notepad (Windows) or TextEdit (Mac, set to plain text).
- Paste this line with your ID:
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0. - Press Enter once after the line.
- Save the file as
ads.txtwith UTF-8 encoding and plain text only.
- Connect to your server with an FTP client
- Open your FTP client and connect using your host, username, password, and port.
- Look for the site’s root directory. On many hosts, it is named
public_html,www, or the folder wherewp-config.phplives.
- Upload and verify
- Drag
ads.txtinto the root directory. - Visit
https://yourdomain.com/ads.txtin your browser. You should see the single line, no extra characters.
- Drag
Common mistakes to avoid:
- Wrong location: Do not put
ads.txtinside a subfolder like/wp-content/or a subdomain unless that is your public site. - Bad formatting: Extra spaces, extra commas, smart quotes, or hidden characters can break validation.
- Wrong filename: Use lowercase
ads.txtwith no extra extensions like.txt.txt.
Why this method?
- You control the file, versioning, and custom entries.
- It can be tricky for non-technical users since FTP, permissions, and paths vary by host.
Easy Plugin Method: Install Ads.txt Manager in Minutes
If you prefer a quicker setup with fewer chances for mistakes, use a plugin. You will not touch FTP, and updates become simple.
- Install the plugin
- In WordPress, go to Plugins, then Add New.
- Search for “Ads.txt Manager.”
- Click Install Now, then Activate.
- Add your ads.txt entry
- Go to Settings, then Ads.txt in your WordPress dashboard.
- Paste the line:
google.com, pub-ID, DIRECT, f08c47fec0942fa0with your real publisher ID. - Click Save.
- Confirm it is live
- Visit
https://yourdomain.com/ads.txtand check that the line appears exactly as you saved it.
- Visit
Why this method?
- No FTP or file permissions required.
- Easy to manage additional sellers later, one per line.
- Free, fast, and less error-prone for beginners.
Tip: If you add more partners in the future, put each one on a new line. Keep the file in plain text format. For more clarity on AdSense identifiers, see Google’s notes on client and pub IDs.
How to Verify Your Ads.txt File is Working Correctly
Once your ads.txt is in place, take a minute to verify it. A quick check today prevents lost revenue tomorrow. You want the file to be readable at a public URL, cached correctly, and picked up by Google without delay.
Start with a live test. Visit https://yourdomain.com/ads.txt in a browser. You should see your exact entries on plain text lines. For AdSense, the key line looks like: google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0. If it 404s, downloads, or shows HTML, something is off. Try again in a private window to bypass local cache.
Next, confirm indexing. Add the ads.txt URL in Google Search Console so it gets crawled fast. This helps ad systems discover updates sooner. If you use a CDN or caching plugin, purge cache after every change. Then wait a few minutes and reload the URL.
What success looks like:
- The URL loads plain text within a second or two.
- The file content matches your AdSense details, with clean commas and no extra spaces.
- AdSense removes any warnings after the next crawl, often within 24 hours.
Tip: Keep a copy of your current file in a safe place. If a plugin update or migration overwrites it, you can restore it in seconds.
Spotting and Fixing the ‘Ads.txt Not Found’ Error in AdSense
If AdSense says “Ads.txt Not Found,” Google cannot fetch your file. That hurts demand and can lower earnings. The fix is usually simple once you check the basics.
Common causes:
- Wrong file location: The file sits in a subfolder instead of the site root.
- Typos in your publisher ID: Extra characters or missing digits break validation.
- Caching blocks: CDN or plugin cache serves an old or empty version.
Quick fixes:
- Re-upload to the root: Place
ads.txtin the top-level folder wherewp-config.phplives. Do not put it in/wp-content/or a theme folder. - Check your ID: Copy your AdSense publisher ID fresh from your account and paste it into the line. Keep commas and capitalization exact.
- Clear cache: Purge your caching plugin and CDN. If you use a firewall or proxy, purge there too. Then reload
https://yourdomain.com/ads.txt.
Example: If you are on a subdomain like blog.yourdomain.com, the file for that subdomain must live at https://blog.yourdomain.com/ads.txt. Ads on that subdomain read only that file.
Simple verification checklist:
- Open
https://yourdomain.com/ads.txtin a browser. Does it show your text? - Compare the pub-ID to your AdSense account. Is every character correct?
- No extra spaces, quotes, comments, or stray characters in the file?
- Cleared plugin cache and CDN cache after changes?
- Submitted the ads.txt URL in Search Console for indexing?
- Checked again in an incognito window and on mobile data?
- Reviewed AdSense a few hours later for cleared alerts?
Run this checklist any time you update ads.txt. It keeps your ads authorized, reduces “at risk” warnings, and gives buyers the confidence to bid on your inventory.
Troubleshooting Common Ads.txt Problems on WordPress and AdSense
Ads.txt warnings can stall earnings, especially on WordPress where plugins, caches, and redirects can hide simple mistakes. The fastest wins come from checking your publisher ID, trimming bad lines, and keeping only trusted sellers. Use the steps below to clear “Earnings at risk” alerts and protect your revenue.
Handling Publisher ID Issues and Fraud Warnings
Your publisher ID ties your inventory to your AdSense account. If it is wrong or missing, buyers may stop bidding. Find it in AdSense and copy it exactly, including the pub- prefix. Google explains where it appears across your account in this guide on the Publisher ID.
Quick checks that fix most ID problems:
- Match the format:
pub-1234567890123456, no spaces or extra symbols. - Use the correct certification ID for AdSense:
f08c47fec0942fa0. - Keep one clean line for AdSense. Extra or duplicate lines can confuse crawlers.
- Clear caches after edits. Purge your caching plugin and CDN, then reload
https://yourdomain.com/ads.txt.
Common WordPress pitfalls:
- Plugin conflicts: Two ads.txt plugins can override each other. Keep one active.
- Wrong file location: The file belongs at the domain root, not in a subfolder.
- Theme or security filters: Some themes or firewalls block
ads.txtoutput. Temporarily disable, test, then re-enable with an allow rule.
Why this matters for fraud and revenue:
- Without a correct ads.txt, unauthorized sellers can claim your inventory.
- Buyers may pull back, which lowers CPMs and fill.
- Keeping a lean, accurate file makes validation fast and raises trust. For more context on abuse patterns, see DoubleVerify’s analysis of how fraudsters exploit ads.txt.
If you work with multiple ad networks:
- Add only trusted partners. Ask each partner for their exact ads.txt line.
- Use
DIRECTwhen you have a direct contract. UseRESELLERonly for vetted resellers. - Audit quarterly. Remove sellers you no longer use, or lines you cannot verify.
- Keep a changelog. Note dates, partners, and reasons for every edit.
When to contact support:
- AdSense still shows “Earnings at risk” 48 hours after a correct fix.
- The file loads fine, but Google reports a different or old version.
- You suspect a misuse of your pub-ID across other domains.
- Share the live
ads.txtURL and account details with AdSense support. - Provide a list of recent changes and screenshots of your settings.
- Share the live
Fast action helps. Confirm the ID, trim noise, purge caches, then recheck the alert. Most publishers see warnings clear within a day once the file is clean and live.
Conclusion
Fixing ads.txt is quick wins with big upside. Grab your publisher ID, add a clean line, place the file at your root or use a plugin, then verify it loads and clear cache. You get protected earnings, stronger buyer trust, and fewer “Earnings at risk” warnings.
Make the update today, then keep an eye on your AdSense dashboard for cleared alerts. Share what worked for you in the comments, and subscribe for more WordPress fixes that safeguard revenue.
