How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way

Did you come across Earnings at risk Error after Google AdSense Account Approval Process? Let`s point out a few details before we get started with How to Create and Implement Ads.txt File in WordPress for Google AdSense

Ads.txt file protects publishers from ad fraud, and it will probably increase your ad revenue.

A missing declaration in your ads.txt file might lead to the following warning message in your Google AdSense account.

Troubleshoot and Fix Earnings at risk Error in AdSense - How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way
Troubleshoot and Fix Earnings at risk Error in AdSense – How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way
Troubleshoot and Fix Earnings at risk Error in Google AdSense – One or more of your ads.txt file doesn’t have Ads.txt File which includes your unique AdSense publisher ID. So get this error Fixed now to avoid severe impact on your revenue or a dip for your revenue.

If you`re seeing this above error message on your AdSense account dashboard, then it means that your Ads.txt File is not found or doesn’t have your publisher ID.

So in this article, we will show you what ads.txt file is and How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way.

What is Ads.txt File?

Ads.txt stands for Authorized Digital Sellers and this project is aimed at increasing the programmatic advertising ecosystem. Ads.txt is quite simple, flexible and a more secure method or implementation available to publishers which allows ads publishers and distributors to publicly list or declare their list of the authorized digital seller or digital inventory reseller or who can and will sell ads on their blog/website.

This initiative is created by Interactive Advertising Bureau – IAB Tech Lab a non-profit company focused on improving digital advertising standards, to enable publishers to take control over who can sell their ad inventory and to fight fraud and misrepresented domains for ad inventory.

The initiative is backed up and supported by Google’s advertising platforms or networks like Google AdSense, Doubleclick, and Ad Exchange. It is additionally supported by several different leading digital advertising platforms.

Necessary Requirements on How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way


An Ads.txt file includes the following four (4) fields in a single line of code.
Domain Name (Owner): The domain name is google.com which specify that it’s allowed to sell or resell your ad inventory.
Publisher IDs: The publisher ID denoted with pub-0000000000000000 is your unique publisher ID assigned to your Google AdSense Account.
Relationship: this field declares a Direct or RESELLER kind of relationship. See examples for Ads.txt file for publishers using Google Products.

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
google.com, pub-0000000000000000, RESELLER, f08c47fec0942fa0


Certification Authority ID: The Certification Authority ID is the last field and it’s a unique ID for the advertising platform or system and is certified by Trustworthy Accountability Group (TAG). Therefore, for all google advertising programs use the same ID.


Why is Ads.txt File Important?

Ad fraud cost lots of bucks in damages to online advertisers and publishers every year. People with malicious intent unendingly attempt to trick ad platforms with domain spoofing, fake clicks, fake impressions, and more.

Ads.txt file improves transparency in on-line advertising by permitting publishers to declare who will sell their ad inventory. Here is how it works:

If you’re an advertiser and somebody tells you that they will show your ad on a selected web site, then you can go and check out that website’s ads.txt file. It will show you if the company you’re handling or dealing with has the permission to sell the advertising area on its specific web site or not.

Since this data is publicly available, it can be crawled, stored, and searched by advertisers, publishers, and resellers.

If you’re displaying ads on your web site using Google AdSense, DoubleClick, or Ad Exchange, then adding Ads.txt file is recommended. Much alternative advertising platform and software system additionally support or need ads.txt file to be declared.


How to Get Your Google AdSense Unique Identifier ID or Publisher ID

Step 1: Log-in to your Google AdSense Account

Step 2: Click Settings from the left pane

Step 3: Click Account information

Step 4: Viola, there is your Unique Identifier ID shown on top like this: Publisher ID? Pub-0000000000000000.  

2 Methods on How to Create and Implement Ads.txt File in WordPress

Method 1: How to Create and Implement Ads.txt File in WordPress for Google AdSense Using WordPress Plugin

Step 1: Install and Activate the Ads.txt Manager Plugin. For additional details, see our step by step guide on How to Install a WordPress Plugin.
Step 2: Upon activation, hover or go to the Settings » Click Ads.txt page to configure plugin settings.
The plugin provides an easy text space or area where you’ll be able to add lines to declare every individual platform or reseller.
For Instance, you need to add the following line of code to declare Google AdSense in your ads.txt file as shown below.

Direct Ad Inventory: google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Reseller Ad Inventory: google.com, pub-0000000000000000, RESELLER, f08c47fec0942fa0

Ensure to replace pub-0000000000000000 with your own Google AdSense Publisher ID.

Insert ads.txt file - How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way
Insert ads.txt file – How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way

As you can see from the image above, the first line of code (Line 1) has four 4) fields separated by a comma.

Field 1: The first field which is google.com is that the domain name of the company allowed to sell or resell your ad inventory.
Field 2: After that, it’s pub-0000000000000000 which is your publisher unique ID that corresponds to your Google AdSense Unique Account ID within the advertising platform.
Field 3: The third field which is DIRECT declares relationship kind/type that is DIRECT or RESELLER.
Field 4: The fourth or last field which is f08c47fec0942fa0 is optional and it represents an ID of the advertising platform. Therefore, for all Google advertising programs, you’ll use the same pre-defined unique ID.

Method 2: How to Create and Implement Ads.txt File in WordPress for Google AdSense Via cPanel

Step 1: Login to your cPanel account. You can either log in through the shortcut from your host provider dashboard or log in with this format: https://www.example.com/cpanel.

Step 2: Navigate to Files Tab and click File Manager to take you to the root directory.

Step 3: Click public_html folder; From the top left corner, click File to create a new file in your root directory and name it ads.txt

Step 4: Select the ads.txt file and click edit from the top.

Step 5: Paste your single line of code from the four field ads.txt we created above and remember to Click Save Changes.

Note: It takes 24 – 48 hours for the changes to take effect and implement your new ads.txt file.

Bonus Tips on How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way


•Ensure that the ads.txt file can be crawled by Google Crawler
•Confirm that the ads.txt file is not temporarily unavailable
•Confirm that the ads.txt file is reachable from the root domain
•Ensure that the ads.txt file is not disallowed by robots.txt
•Ensure that the ads.txt file is returned with HTTP 200 OK status code
•Ensure that there is no documentation format or formatting errors or invalid characters in the field
•Make sure that the ads.txt file reachable via both HTTP and HTTPS
•Confirm that your server/CDN isn`t returning an invalid response to the Google Crawler

Point to Note on How to Create and Implement Ads.txt File in WordPress

So since ads.txt file is required and supposed to be in the root directory of a domain name, this plugin currently only works for a root-level domain like example.com. It doesn’t work for WordPress installed in a subdomain, subdirectory, or a single site in a multi-site network.

We hope this article helped you find out How to Create and Implement Ads.txt File in WordPress for Google AdSense the Right Way. You may also check out our guide on How to Add Header and Footer Code in WordPress Site.

Are you able to troubleshoot and fix your Google AdSense Ads.txt Error? Let us know in the comment section below and follow us on PinterestFacebook, and Twitter for more updates.

LEAVE A REPLY

Please enter your comment!
Please enter your name here