How to Fix Google AdSense "Earnings at Risk: ads.txt file missing" in WordPress

Adnan Naseem
WordPress Developer & SEO Expert

You finally did it. You published dozens of high-quality blog posts, you applied for Google AdSense, and you got the glorious approval email. You log into your AdSense dashboard expecting to see your first few dollars rolling in.
Instead, you are greeted with a terrifying, bright red warning banner at the top of your screen:
"Earnings at risk - You need to fix some ads.txt file issues to avoid severe impact to your revenue."
Panic sets in. Are your ads going to be disabled? Is your account being banned? Don't worry. This is the single most common error new publishers face, and it has absolutely nothing to do with your content quality. It is a simple technical requirement designed to stop ad fraud.
Today, I am going to explain exactly what an `ads.txt` file is, why Google demands it, and the two easiest ways to fix this error in WordPress in under five minutes—without needing to hire a developer.
Table of Contents
1. What is an ads.txt File and Why Do You Need It?
The "ads.txt" initiative (Authorized Digital Sellers) was created by the Interactive Advertising Bureau (IAB). It is basically a public ID badge for your website.
Years ago, scammers would create fake websites and trick advertisers into buying ads on them, pretending to be premium websites (like Forbes or CNN). To stop this fraud, the industry created a rule: Publishers must host a simple text file on their domain that publicly lists exactly who is authorized to sell ads on their site.
When Google sees that your site is missing this file, they show you the "Earnings at risk" warning because buyers on the Google Ad Exchange might refuse to bid on your ad space until your identity is verified. If you don't fix it, your revenue will drop significantly.
2. Step 1: Finding Your Unique Publisher ID
To fix the error, we need to generate one specific line of text containing your unique Google AdSense ID.
Log into your Google AdSense dashboard. Click on the "Fix Now" button on the red warning banner, or go to Account > Settings > Account Information. You will see your Publisher ID, which looks like this: `pub-1234567890123456`.
Your complete ads.txt code string will look exactly like this (just replace the zeros with your actual publisher ID):
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
Copy that entire string of text. Be careful not to add any extra spaces or hidden line breaks.
🚀 Pro Tip: Clean Your Code
If you accidentally copied this code from a rich-text document or an email, it might have hidden formatting that breaks the file. Paste your snippet into our free Advanced Format Cleaner to strip it to pure plain text before adding it to your website.
3. Method 1: The Easy Way (Using a Free Plugin)
If you are a beginner and don't want to mess with your website's server files, this is the safest and fastest way to fix the issue in WordPress.
- Log in to your WordPress Admin Dashboard.
- Go to Plugins > Add New.
- In the search bar, type Ads.txt Manager (look for the one created by 10up, it is the most reliable).
- Click Install Now, then Activate.
- Once activated, go to Settings > Ads.txt in your left-hand WordPress menu.
- A large text box will appear. Paste the code string you copied in Step 1 (`google.com, pub-...`) directly into this box.
- Click Save Changes.
That is it! The plugin automatically generates a virtual `.txt` file at the root of your domain. You are done.
4. Method 2: The Pro Way (Via cPanel / File Manager)
If you want to keep your WordPress site lean and avoid installing extra plugins, you can create the file manually. This requires access to your web hosting account (like Hostinger, Bluehost, or SiteGround).
- Open a simple text editor on your computer (Notepad on Windows or TextEdit on Mac).
- Paste your code string into the blank document: `google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0`
- Save the file to your desktop. You must name it exactly `ads.txt` (all lowercase).
- Log into your hosting account and open your File Manager or cPanel.
- Navigate to the public_html folder (this is the "root" folder of your website where your `wp-config.php` file lives).
- Click the Upload button and upload the `ads.txt` file you saved on your desktop directly into this `public_html` folder.
5. How to Verify Your Fix Worked
Whether you used the plugin or the cPanel method, you need to verify that the file is publicly visible to Google's bots.
Open a new browser tab and type in your website URL followed by `/ads.txt` (for example: https://yourwebsite.com/ads.txt).
If you did it correctly, a plain white screen should load displaying only your code string. If you get a 404 Error page, or if it redirects to your homepage, something went wrong, and you need to ensure the file was placed in the root directory, not a subfolder.
Why is the Warning Still There?
Don't panic if you fixed the file and the red "Earnings at Risk" banner is still showing in your AdSense dashboard. Google does not update this instantly.
It typically takes Google's crawlers anywhere from a few days to a couple of weeks to re-crawl your domain, verify the file, and remove the warning. As long as you can see the text when you visit `yourwebsite.com/ads.txt`, you have done your job. Just be patient, keep publishing great content, and the error will clear itself.