How to Fix Google AdSense "Earnings at Risk: ads.txt file missing" in WordPress
WordPress Troubleshooting August 6, 2026 7 Min Read

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

Adnan Naseem

Adnan Naseem

WordPress Developer & SEO Expert

Fix Google AdSense Earnings at Risk ads.txt error

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.

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.

  1. Log in to your WordPress Admin Dashboard.
  2. Go to Plugins > Add New.
  3. In the search bar, type Ads.txt Manager (look for the one created by 10up, it is the most reliable).
  4. Click Install Now, then Activate.
  5. Once activated, go to Settings > Ads.txt in your left-hand WordPress menu.
  6. A large text box will appear. Paste the code string you copied in Step 1 (`google.com, pub-...`) directly into this box.
  7. 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).

  1. Open a simple text editor on your computer (Notepad on Windows or TextEdit on Mac).
  2. Paste your code string into the blank document: `google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0`
  3. Save the file to your desktop. You must name it exactly `ads.txt` (all lowercase).
  4. Log into your hosting account and open your File Manager or cPanel.
  5. Navigate to the public_html folder (this is the "root" folder of your website where your `wp-config.php` file lives).
  6. 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.

Frequently Asked Questions

No, Google will not ban your account. However, without a valid ads.txt file, many advertisers will refuse to bid on your ad space, which will result in a severe drop in your earnings or blank ad spaces on your website.
It is not instant. It usually takes a few days, but Google explicitly states it can take up to a month for their crawlers to re-check your domain and clear the warning from your dashboard.
That string (`f08c47fec0942fa0`) is the universal Certification Authority ID for Google. Every single person using Google AdSense has that exact same alphanumeric code at the end of their ads.txt string. Do not change it.
You must place each ad network's ID on a separate line within the same ads.txt file. Premium networks like Ezoic or Mediavine usually manage this file automatically for you via their own dashboard or plugin, so you may just need to paste your AdSense code into their specific settings.
This is usually caused by an aggressive caching plugin or a security plugin blocking access to .txt files. Clear your website cache, and check your security plugin settings to ensure .txt files are allowed to be publicly viewed.
No. According to IAB specifications, the ads.txt file must be located at the root level of your main domain (e.g., yoursite.com/ads.txt). It will not be validated if placed in a subfolder like yoursite.com/blog/ads.txt.
For Blogger, you don't need a plugin or cPanel. Go to Settings > Monetization, toggle on "Enable custom ads.txt", and paste your Google code string directly into the box provided there.
No. The Ads.txt Manager by 10up is an incredibly lightweight plugin. It does not load heavy scripts on your front-end; it simply creates a virtual rewrite rule to display the text file. It has zero impact on your site speed or Core Web Vitals.
Double-check your Publisher ID. A very common mistake is missing a digit or accidentally copying a space at the end of the string. You should also ensure the file is named exactly "ads.txt" and not "ads.txt.txt" (which can happen if Notepad hides file extensions).
If you only use Google AdSense, you never have to touch it again. However, if you join additional ad networks or affiliate programmatic platforms in the future, they will ask you to add their specific lines of code to this file.
Scroll to Top