Mastering Ads.txt in WordPress: A Step-by-Step Guide to Creation and Management

Safeguarding your WordPress site against advertising fraud is essential, and it can be straightforward. The ads.txt file is a valuable tool that helps protect your advertising revenue and brand integrity.

Although CanadaCreate does not display ads, many of our team members have significant experience in managing ad-supported websites. Additionally, numerous users depend on advertising revenue to sustain their online ventures, making it vital to get this process right.

In this guide, we will provide you with two easy methods to create and manage an ads.txt file in WordPress.

Why Should You Create and Manage Ads.txt Files in WordPress?

Ads.txt stands for ‘Authorized Digital Seller.’ This file indicates which companies are authorized to sell ads on your WordPress site and helps prevent counterfeit ads from being displayed.

If you earn income from blogging through advertisements (such as Google AdSense), it’s advisable to include an ads.txt file on your website.

This is important because unauthorized individuals may falsely claim they have your consent to sell ads on your WordPress blog. This could result in the display of harmful or misleading ads, jeopardizing your reputation and the safety of your users.

The ads.txt file acts as a protective barrier, ensuring that only approved sellers can display ads on your WordPress blog. This helps secure your site and guarantees that only advertisements from trusted partners are shown.

Now, let’s explore how to create and manage an ads.txt file in WordPress. We will guide you through two different methods. You can use the quick links to jump to a specific section:

  • Method 1: Create an Ads.txt File in WordPress Using WPCode (Recommended)
  • Method 2: Create an Ads.txt File in WordPress Using Ads.txt Manager (Free)
  • How to Resolve the Earnings at Risk Error in Google AdSense

Creating and managing an ads.txt file involves some coding. If you’re not comfortable adding custom code yourself, this process might feel daunting.

That’s why we suggest using WPCode, the top code snippet plugin available. With it, you can avoid directly modifying your WordPress code and the potential risks of breaking your website.

This plugin provides an intuitive interface that allows you to easily and securely add custom code to your WordPress site. You can view all your added codes in one centralized location, making it simple to manage your customizations.

In this guide, we will utilize the WPCode Pro version. Although there is a free version of the WPCode plugin, the necessary feature for managing ads.txt files is only available in the Pro version.

First, install the WPCode plugin from your WordPress dashboard. If you need assistance, you can refer to our detailed guide on how to install a WordPress plugin.

Next, ensure that you activate your WPCode Pro license key. Simply navigate toCode Snippets»Settingsand enter your license key in the designated field. Then, click the ‘Activate Key’ button.

You will know the activation is successful when the button text changes to ‘Deactivate Key.’

Now, head over toCode Snippets»File Editor. Here, you will find that the plugin includes a built-in ads.txt management feature.

Now, you need to enter the following information in this format: domain, published ID, relationship type, and advertising platform ID (optional).

For instance, we are including Google AdSense as an authorized advertising platform:

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

The first field indicates the domain of the company permitted to sell or resell your ad inventory. In this case, that’s google.com.

Next, you’ll input the publisher ID, which is unique to your account. In this example, it is pub-0000000000000000. If you’re unsure where to locate this ID, consult the online documentation of the network or platform for guidance.

Ensure that the ID is entered correctly. Otherwise, you may encounter the ‘Earnings at risk’ warning.

The third section specifies the relationship type, which can be either DIRECT or RESELLER. DIRECT indicates that the publisher collaborates directly with the AdTech provider.

On the other hand, RESELLER signifies that the publisher has permitted a third party to sell on their behalf, such as an ad network or ad management service.

The final field is the ID of the advertising platform, which is optional.

You can add as many platforms and resellers as needed. Just ensure that each organization is listed on its own line.

When you are finished, simply scroll down and click ‘Save Changes.’

Now, your site’s ads.txt file is accessible to anyone.

To view the ads.txt file, simply append ‘/ads.txt’ to your domain name, like www.example.com/ads.txt.

Method 2: Creating an Ads.txt File in WordPressUsing the Free Ads.txt Manager Plugin

Another option for creating an ads.txt file is to utilize the Ads.txt Manager plugin. This free tool provides a straightforward code editor where you can enter all your authorized platforms and networks.

First, install and activate the Ads.txt Manager plugin for WordPress. For detailed instructions, refer to our step-by-step guide on installing a WordPress plugin.

Once activated, navigate to the Settings » Ads.txt page.

This will open a simple code editor where you can list each platform or reseller’s details on separate lines, just like before.

When you are satisfied with the information you’ve entered, click the ‘Save Changes’ button.

How to Resolve the Earnings at Risk Error in Google AdSense

If you use Google AdSense, you may encounter the following error in your AdSense account:

Earnings at risk – One or more of your ads.txt files is missing your AdSense publisher ID. Address this issue promptly to prevent significant revenue loss.

This indicates that your ads.txt file does not contain the correct publisher ID.

To resolve this issue, log into your AdSense account using your Google email and password. You will find the ID next to the field that states: ‘This email is associated with the AdSense account.’

Next, navigate to WPCode’s File Editor or Ads.txt manager and locate the line that designates Google AdSense as an authorized provider. Update the text to reflect the correct ID.

After making the changes, save your settings. Now, when you revisit your Google AdSense account, the error message should be gone.

Unlock the Full Advertising Potential of Your WordPress Site

Looking to elevate your WordPress advertising strategy? Explore these valuable resources:

  • How to Embed Ads Within Your Post Content in WordPress– Discover how to strategically position ads within your content for optimal visibility and engagement.
  • How to Build a Classified Ads Website with WordPress– Learn how to create a successful classified ads platform using WordPress.
  • How to Show Ads Exclusively to Search Engine Visitors in WordPress– Enhance your ad targeting by displaying them solely to visitors coming from search engines.
  • How to Boost Ad Impressions in WordPress with Ad RefreshEnhance your advertising revenue by utilizing ad refresh techniques in WordPress.
  • How to Show Ad Blocks in Specific WordPress PostsDiscover how to tailor your ad placements by showing specific ad blocks on chosen posts.

We hope this guide has helped you understand how to create and manage ads.txt files in WordPress. You might also be interested in learning how to manage ads in WordPress using the AdSanity plugin and exploring our list of the best-performing Google AdSense banner sizes.

If you enjoyed this article, please subscribe to our YouTube Channel for WordPress video tutorials. You can also connect with us on Twitter and Facebook.

Share This Post
DMCA.com Protection Status Chat on WhatsApp