How to Create and Manage Ads.txt Files in WordPress: Protect Your Website from Ad Fraud (Easy)

by Jay Kang | Posted on July 2nd, 2023

As a website owner, ensuring the integrity of your online advertising is crucial for maintaining a reputable online presence and maximizing your ad revenue. One effective way to protect your site from advertising fraud is by creating and managing ads.txt files in WordPress.

In this comprehensive guide, we will walk you through the process of easily creating and managing ads.txt files in WordPress, providing you with the knowledge and tools to safeguard your website from fraudulent advertising practices.

Why Create and Manage Ads.txt Files in WordPress?

Online advertising fraud has become a significant concern for brands and website owners alike. Unscrupulous individuals may attempt to sell unauthorized ads on your website, which not only damages your reputation but can also result in spammy or malicious advertisements appearing on your WordPress blog. This is where ads.txt files come into play.

Ads.txt (Authorized Digital Sellers) is an industry-standard developed by the IAB Tech Lab to combat ad fraud. It enables website owners to list authorized companies that have permission to sell advertising space on their sites. By making your ads.txt file publicly available, advertisers, publishers, and resellers can verify that they are dealing with approved and legitimate partners.

If you sell ads on your WordPress blog using platforms like Google Adsense, DoubleClick, or Ad Exchange, it is highly recommended to add an ads.txt file to your site to maintain transparency and protect against unauthorized ad placements.

How to Create and Manage Ads.txt Files in WordPress

Creating and managing ads.txt files in WordPress is a straightforward process that can be accomplished using the Ads.txt Manager plugin. This plugin provides a user-friendly interface where you can add the necessary information for authorized platforms and resellers. Here’s a step-by-step guide to help you get started:

  • Install and activate the Ads.txt Manager plugin, which is available for free in the WordPress plugin repository.
  • Once activated, go to the Settings » Ads.txt page in your WordPress dashboard.
  • You’ll be presented with a simple code editor where you can add each platform or reseller on a separate line. For example, if you want to add Google AdSense as an approved advertising platform, use the following format:, pub-0000000000000000, DIRECT, f08c47fec0942fa0 
  • In this format, the first field represents the domain of the authorized company (e.g., The second field is your unique publisher ID, which can be found in the network or platform’s documentation. The third field indicates the relationship type, either “DIRECT” or “RESELLER.” The optional fourth field represents the ID of the advertising platform.
  • You can add as many platforms and resellers as necessary by adding each organization on its own line.
  • Once you’ve entered all the relevant information, click the Save Changes button to store your settings.

Congratulations! Your WordPress site now has an ads.txt file that can be accessed by anyone. To view the file in action, simply add /ads.txt to the end of your domain name (e.g.,

Fixing the “Earnings at Risk” Error in Adsense

If you are using Google Adsense and encounter the “Earnings at Risk” error in your AdSense account, it means that your ads.txt file does not contain the correct AdSense publisher ID. To resolve this issue, follow these steps:

  1. Log into your AdSense account using your Google email address and password.
  2. Locate your publisher ID, which can be found next to the field that states “This email is associated with the AdSense account.”
  3. In your WordPress dashboard, go to Settings » Ads.txt and find the line that adds Google AdSense as an authorized provider.
  4. Update the text to include your correct publisher ID.
  5. Don’t forget to click on Save Changes to store your settings.

By making these changes, the error message should disappear when you revisit your Google AdSense account.


Creating and managing ads.txt files in WordPress is an essential step in protecting your website from advertising fraud. By following the simple steps outlined in this guide, you can safeguard your online presence, establish trust with advertisers and partners, and maximize your ad revenue. Remember to keep your ads.txt file up to date with any changes in authorized platforms and resellers.

Jay Kang

Jay Kang, entrepreneur and SEO expert, is the driving force behind innovative platforms like and His latest creation, ProductReview.Tools, provides affiliate marketers with a powerful WordPress plugin for crafting high-converting reviews. Committed to empowering marketers, Jay continues to make a positive impact in the digital marketing space.