How to Configure Custom Ads.txt on a Blogger Website

A computer screen displaying the WordPress plugin installation page with various software options
Photo by Justin Morgan on Unsplash

What You Will Learn

  • Enable the native custom ads.txt switch in Blogger settings rather than editing your theme template code.
  • Format the seller declaration using your exact AdSense publisher ID with commas separating the four standard parameters.
  • Verify the live plain-text output at your domain's root /ads.txt path and allow 24 to 48 hours for Google crawlers to update.

What Is Blogger Custom Ads.txt and Why Do You Need It?

To configure custom ads.txt on Blogger, you simply turn on the native Custom ads.txt toggle inside your Blogger dashboard settings, paste your formatted seller record containing your exact AdSense publisher ID, and save your changes. Once saved, your blog immediately serves a dedicated plain-text file at yourdomain.com/ads.txt that confirms you own the ad inventory.

The term ads.txt stands for Authorized Digital Sellers. It is a public initiative created by the Interactive Advertising Bureau (IAB) Tech Lab. Its purpose is simple: it allows website owners to declare publicly which advertising systems are authorized to sell ad space on their websites. When media buyers and automated ad exchanges bid for ad slots on your blog, their systems scan your root /ads.txt file to confirm that the seller is legitimate.

If your blog displays Google AdSense ads but lacks a valid ads.txt file, or if the file contains an incorrect publisher ID, buyers cannot verify your website. As a result, AdSense shows an alert in your dashboard stating that your earnings are at risk, and advertisers may reduce their bids or stop serving ads to your pages altogether.

Prerequisites Before You Start

Before opening your Blogger dashboard, gather these essential items so you can complete the setup in one sitting:

  • An active Google AdSense account: You must have an approved or reviewing AdSense account associated with your blog. If you have not linked your platform yet, review How to Connect AdSense to Blogger Step by Step before proceeding.
  • Your 16-digit AdSense Publisher ID: This unique string starts with pub- followed by 16 numeric digits (for example, pub-0000000000000000).
  • Administrative access to Blogger: You must log in using an account with administrative permissions for the target blog. Author-level accounts cannot view or modify monetization settings.
  • A plain-text editor: Use a basic editor like Notepad or TextEdit to review your lines. Do not use word processors like Microsoft Word or Google Docs, because they often convert standard straight quotes or commas into stylized typographic characters that break ads.txt syntax.

Step 1: Confirm Your Correct AdSense Publisher Account

Let us do this step by step. The most common reason an ads.txt file fails verification is a mismatch between the publisher ID declared in the file and the publisher ID running in the site ad code.

Follow these steps to find your exact publisher ID:

  1. Sign in to your Google AdSense dashboard.
  2. In the left navigation menu, click Account, then select Settings, and choose Account information. (Interface labels can change slightly over time, so look for your general account details section).
  3. Locate the line labeled Publisher ID. It looks similar to: pub-1234567890123456.
  4. Copy this entire string to your clipboard. Keep the pub- prefix intact, because the ads.txt declaration requires the full prefix.

Maintaining clear, policy-compliant account details helps keep your account in good standing AdSense Policies: A Beginner's Guide. If you manage more than one AdSense account, double-check that you are copying the ID for the specific account that was approved for this blog.

Step 2: Locate Supported Blogger Controls

Blogger provides a built-in interface designed specifically for ads.txt management. You do not need to modify your XML theme file, inject scripts into your layout, or upload files through third-party FTP servers. Attempting to add ads.txt records inside your theme HTML will not work because web crawlers look exclusively for a plain-text file served at the root URL path.

To locate the native control:

  1. Open your web browser and sign in to the Blogger dashboard.
  2. If you run multiple blogs, use the dropdown menu in the upper-left corner to select the correct blog.
  3. Click Settings in the left sidebar.
  4. Scroll down the Settings page until you reach the section labeled Monetization.
  5. You will see an option labeled Enable custom ads.txt with an on/off toggle switch beside it.
  6. Click the toggle to turn it On. The toggle changes color, and a sub-setting named Custom ads.txt becomes clickable directly underneath it.
turned-on monitor
Photo by Stephen Phillips - Hostreviews.co.uk on Unsplash

Step 3: Preserve Existing Authorized Entries

Before typing anything into the field, click on Custom ads.txt to open the text dialog. If this is a brand-new blog, the dialog will be empty. However, if you have previously configured another ad network or affiliate partner, text may already be present in this box.

Apply this decision rule:

  • If the box is completely empty: You can proceed directly to formatting your AdSense seller line.
  • If the box already contains text: Copy all existing lines and paste them into a local backup text file on your computer. When you add your new AdSense line, paste it on a brand-new line at the bottom. Never delete existing lines unless you have intentionally terminated your relationship with those other ad networks.

Deleting authorized seller lines for other networks will immediately invalidate their permission to sell your inventory, which can freeze your earnings across those secondary platforms.

Step 4: Format and Add the Required Seller Line

The standard AdSense declaration consists of four comma-separated fields on a single line. The official syntax structure is:

google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0

Let us understand what each component in this line means:

  1. Domain of the advertising system (Field 1): This is always google.com for Google AdSense. It identifies the canonical domain of the exchange operating the ad system.
  2. Publisher Account ID (Field 2): This is your unique 16-digit AdSense identifier (for example, pub-1234567890123456). It tells buyers exactly which publisher account receives credit for the ad display.
  3. Relationship Type (Field 3): For regular AdSense publishers who directly control the website and the AdSense account, this value must be DIRECT. If you work through a third-party agency or an ad management company that sells your inventory on your behalf, this value is set to RESELLER.
  4. Certification Authority ID (Field 4): For Google AdSense, this tag is always f08c47fec0942fa0. This is the official identifier for the Google ad exchange within the Trustworthy Accountability Group (TAG) registry.

Direct vs Reseller Relationship Comparison

Relationship Type When to Use Field 3 Value Example Situation
Direct Seller You own or directly manage the site and hold your own AdSense account. DIRECT A standard Blogger webmaster monetizing via their personal AdSense account.
Reseller Partner A third-party monetization partner manages and sells your ad spaces. RESELLER An ad network or agency monetizing your traffic through their parent Google account.
Illustrative Example:
Suppose your AdSense Publisher ID is pub-9876543210123456. You directly own and manage your blog.

Your exact entry inside the Blogger Custom ads.txt field must look like this:
google.com, pub-9876543210123456, DIRECT, f08c47fec0942fa0

Notice that there are no quotation marks, no HTML tags, and exactly three commas separating the four parameters.

Paste your completed line into the Custom ads.txt text box in Blogger. If you need a deeper overview of the specification itself across different server platforms, you can also consult How to Create and Verify an Ads.txt File for AdSense. Once pasted, click Save in the lower-right corner of the dialog box.

Step 5: Check the Public ads.txt Address

Once you click Save, Blogger updates its routing table immediately. You do not need to wait hours just to see if the file is live on the web. You can test it right away using any web browser.

Follow these verification steps:

  1. Open a new browser tab in Incognito or Private Browsing mode to bypass local browser caching.
  2. In the address bar, type your full blog URL followed by /ads.txt.
    If you use a custom domain, type: https://www.yourdomain.com/ads.txt.
    If you use a free Blogspot subdomain, type: https://yourblogname.blogspot.com/ads.txt.
  3. Press Enter to load the address.

Evaluate the result on your screen:

  • Success state: The browser displays a plain white screen containing only your plain-text record: google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0. No blog headers, footers, sidebars, or HTML styling should surround the text.
  • Failure state (404 Error): The page returns a "Page Not Found" message. This indicates that the Enable custom ads.txt toggle was not switched on, or you forgot to hit Save.
  • Failure state (Theme Layout Visible): Your blog's regular visual template loads with a "Post not found" error inside the post area. This happens when a custom template has conflicting URL redirection rules or when the ads.txt setting is disabled.

Step 6: Recheck Crawling Status Later

A common source of confusion among publishers is the AdSense alert warning: "Earnings at risk - You need to fix some ads.txt file issues to avoid severe impact to your revenue."

Even though your public URL shows the correct line immediately, this dashboard alert will not vanish immediately. The AdSense crawler visits websites periodically on its own automated schedule. It does not check your file in real time the moment you click save.

Here is what you should expect regarding crawling timelines:

  • Initial crawl: The automated Google crawler usually indexes changes to ads.txt files within 24 to 48 hours.
  • Status update: Once the crawler reads the file, your AdSense dashboard updates the status under the Sites menu.
  • Alert dismissal: The warning banner at the top of your AdSense dashboard typically disappears within 48 to 72 hours after a successful crawl.

To verify the crawler status inside your Google AdSense dashboard manually:

  1. Sign in to your AdSense dashboard.
  2. Click Sites in the navigation sidebar.
  3. Find your blog URL in the site list.
  4. Look at the column titled ads.txt status. When operating normally, it displays a green status labeled Authorized.
  5. If it shows Not found or Unauthorized, click on the site row to see the exact timestamp of the last crawl attempt. If the last crawl occurred before you added the file, simply wait for the next scheduled pass.
flat screen monitor
Photo by Stephen Phillips - Hostreviews.co.uk on Unsplash

Common Mistakes to Avoid

Small typographical mistakes can prevent crawlers from reading your ads.txt line. Watch out for these frequent setup errors:

  • Typing the ID without the prefix: Entering google.com, 1234567890123456, DIRECT, f08c47fec0942fa0 will fail. The publisher string must include the prefix: pub-1234567890123456.
  • Accidental spaces inside fields: Ensure there are no spaces within the ID itself (for example, pub- 123456) or before the certification hash. Spaces following commas are acceptable, but characters inside the strings will corrupt the verification.
  • Using lowercase letters for DIRECT: The relationship indicator must be entered in all capital letters: DIRECT. Entering direct or Direct violates the IAB specification standard.
  • Pasting HTML code: Never paste tags such as <p>, <script>, or <div> into the Custom ads.txt field. The output must remain pure plain text.
  • Entering the wrong Google certification hash: The last value, f08c47fec0942fa0, is constant for all Google AdSense accounts. Do not alter or substitute this string with your publisher ID.
  • Policy non-compliance during setup: Ensuring your ad code and declarations are technical sound is just one aspect of maintaining ad revenue; publishers must also adhere to baseline ad placement policies and avoid misleading clicks AdSense Program Policies.

How to Verify Your Result Using Terminal Tools

If you want to perform a technical verification beyond just opening your browser, you can inspect the HTTP response headers. An ads.txt file must return an HTTP 200 OK status code and serve the correct content-type header (text/plain).

If you have access to a command terminal (macOS, Linux, or Windows PowerShell with curl installed), run this command:

curl -I https://www.yourdomain.com/ads.txt

Examine the output lines returned by the server:

  • HTTP/2 200 or HTTP/1.1 200 OK: This confirms the server found the file successfully.
  • content-type: text/plain; charset=UTF-8: This confirms Blogger is serving the file as pure plain text rather than an HTML webpage.

If the response returns a status code of 301 or 302 redirecting to another page, verify that your custom domain canonical redirect (from naked domain to www, or vice versa) is configured cleanly in your Blogger domain settings.

Limitations, Technical Boundaries, and Rollback Steps

While Blogger makes custom ads.txt setup easy, there are several platform-specific boundaries to keep in mind:

  • Subdomain handling on Blogspot: If you use a free .blogspot.com address, Blogger automatically provides a default ads.txt file for AdSense. However, manually enabling custom ads.txt overrides that default behavior. If you make a mistake in your manual entry, it will override the working default.
  • Root domain requirements: The IAB specification requires ads.txt to live at the root domain level (for example, example.com/ads.txt). If your custom domain on Blogger uses a subdomain setup (like blog.example.com), crawlers will check example.com/ads.txt first. If your root domain is hosted on another platform (like WordPress or Shopify), your ads.txt entries must be placed on that root host instead of Blogger.
  • Rollback procedure: If you accidentally corrupt your ads.txt file or experience unexpected ad serving issues, you can roll back instantly. Go to Settings > Monetization, click Custom ads.txt, delete the contents, and click Save. Then toggle Enable custom ads.txt to Off. For standard Blogspot addresses, turning the switch off restores Blogger's automated default behavior.

Recommended Next Steps

Now that your custom ads.txt line is saved and verified in your browser, take these immediate next actions:

  1. Bookmark your public /ads.txt URL and inspect it once more to verify that no accidental characters were introduced.
  2. Leave your settings unchanged for at least 48 hours to give the Google AdSense crawler sufficient time to re-index your root domain.
  3. Check your AdSense dashboard after two days under the Sites screen to ensure your blog displays the green Authorized status badge.
  4. Review your overall ad layout and site performance to ensure your banners are positioned cleanly for user readability.

Frequently Asked Questions

How long does it take for the AdSense ads.txt earnings warning to disappear in Blogger?

The warning banner usually disappears within 24 to 48 hours after Google's crawler checks your site. Although your Blogger ads.txt URL updates immediately for visitors, Google crawlers index files on an automated queue. You do not need to resubmit your site; simply keep the toggle enabled and wait for the next crawl pass.

Can I add multiple ad networks to my custom ads.txt file on Blogger?

Yes, you can add multiple networks. Inside the Blogger Custom ads.txt text dialog, place each authorized seller declaration on a separate line. Keep your Google AdSense line intact and paste the records provided by your other ad partners underneath it. Ensure you do not leave blank spaces or HTML markup between lines.

Do I need to enable custom ads.txt if I use a free blogspot.com subdomain?

Blogger provides an automated default ads.txt file for blogspot.com domains when connected to AdSense. However, configuring the Custom ads.txt setting manually is recommended if AdSense displays an earnings at risk alert or if you need to declare additional third-party ad networks alongside Google.

Post a Comment