How to add ads.txt file to your Blogger blog(blogspot) from Adsense


If you host your blog on a blogging platform (or Blogpot), then you will know that Google does not allow you to upload anything on the blog directory, which is different from WordPress.

Until now, this has never seemed to be a challenge for me. However, AdSense made me scratch this for nearly an hour.

Recently, I received a message from Adense asking me to fix "some ads.txt file problems to avoid severely affecting your income."

To solve this problem, I need to upload an ads.txt file in the root directory of my blog.

First of all, what is ads.txt?

Google Adense Help - Ads.txt Guide

Add your publisher ID to an ads.txt file

If your publisher ID is missing from your ads.txt file, you can copy it from your account and add it to your ads.txt file.



  1. Sign in to your AdSense account.
  2. If there's an alert on your homepage, click Fix now. Otherwise, click Sites.
  3. Click the Down arrow Down Arrowto open the "Add your publisher ID to these ads.txt files" message.
  4. Click Copy.
  5. Paste the line into each of your ads.txt files.
  6. Your ads.txt file should now look like this, where pub-0000000000000000 is your own publisher ID:
  7. google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

How to add ads.txt file to your Blogger blog

  • 1. Log in to the blog.
  • 2. In the upper left corner, click the down arrow.
  • 3. Click the blog on which you want to set the ads.txt file.
  • 4. On the left, click Settings.
  • 5. Under "Settings", click "Search Preferences."
  • 6. Under "Monetization", find "Custom ads.txt" and click "Edit".
  • 7. Click Yes.
  • 8. Copy the settings from the third-party monetization provider and paste them into the text box. for example: google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
  • 9. Click Save Settings.

To check the content of the ads.txt file, go to http://<your blog address>/ads.txt.


If you cannot access www.mydomain.com/ads.txt, 404 error. please make sure that your custom domain name has 4 Google dns resolution records added.

How to Fix it?

Redirect from the URL without subdomain to your blog’s URL. To redirect your readers from “mydomain.com” to “www.mydomain.com,” set up a naked redirect:
Go to your domain provider’s website.
Open your DNS settings.
Add these 4 A-records that point to Google IPs:
216.239.32.21
216.239.34.21
216.239.36.21
216.239.38.21

Sign in to Blogger.
In the top left, select a blog.
From the menu on the left, click Settings.
Under "Publishing," turn on Redirect domain (mydomain.com to www.mydomain.com).
How to add ads.txt file to your Blogger blog(blogspot) from Adsense How to add ads.txt file to your Blogger blog(blogspot) from Adsense Reviewed by mattkaydiary on 六月 16, 2021 Rating: 5

没有评论:

Blogger 提供支持.