How to fix Google AdSense warnings about revenue loss risk due to ads.txt issues
Recently, AdSense kept showing a warning about revenue loss risk - you need to fix some ads.txt file issues to avoid serious income damage. Although it’s just a few cents, seeing this prompt still makes you want to properly resolve it, haha.
This is the kind of warning:

Here I share the correct approach to handle this issue.
1. First, download the ads.txt file from AdSense locally and upload it to your server.
Open it in the browser, you should see the ads.txt displayed correctly.

At first, I thought this would solve the problem, but after a couple of days it was still there. At this point, the next step is troubleshooting.
2. Check main domain redirect settings
Google AdSense does not check only the www subdomain. It also checks the apex domain bobobk.com, while www.bobobk.com is just a subdomain. If the main domain does not redirect correctly, AdSense may fail to find the ads.txt file.
So the fix is simple: make sure bobobk.com properly redirects to www.bobobk.com.
2.1 Check CDN settings
My problem was a misconfigured CDN. Here’s the correct method for Cloudflare as an example. Choose your site, go to Page Rules, and set it as shown in the image below.

Note that the URL ends with https://www.bobobk.com/$1 — do NOT forget the $1. Because of missing $1, Google could not fetch ads.txt from bobobk.com.
2.2 Check web server configuration
Here I use Nginx site configuration as an example.
Make sure to include both domain names in the server_name directive.

Finally, open ads.txt in the browser and confirm the correct content is returned. You can also verify the redirect and file response from the command line:
curl -I https://bobobk.com/ads.txt
curl https://bobobk.com/ads.txt
If both checks look correct, the warning usually disappears after AdSense rechecks the domain.
Summary:
Google AdSense usually shows this warning because it cannot reliably fetch
ads.txtfrom the main domainbobobk.com. In practice, the key checks are the CDN redirect rule, the Nginx domain configuration, and whether the apex-domainads.txtURL returns the expected content.
- 原文作者:春江暮客
- 原文链接:https://www.bobobk.com/en/425.html
- 版权声明:本作品采用 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议 进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。