Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Create and Manage Ads.txt files in WordPress

Do you want to create and manage an ads.txt file in WordPress?

If your website gets caught up in fraudulent advertisements, then it can damage your reputation and cost you money. By adding a simple ads.txt file to your website, you can protect your site, partners, and publishers from advertising fraud, and possibly increase your ad revenue.

In this article, we will show you how to easily create and manage an ads.txt file in WordPress.

How to create and manage ads.txt files in WordPress

Why Create and Manage Ads.txt files in WordPress?

Selling advertising space is a great way to make money online blogging with WordPress. However, online advertising fraud is also a huge problem for both brands and website owners.

Let’s look at an example. Imagine a brand wants to place an ad on your WordPress website. They find a seller who claims they have a relationship with you, and can place advertisements on your website.

This third party might be one of your approved partners, or they might be committing online advertising fraud by selling unauthorized ads.

If your site gets caught up in advertising fraud, a third party may buy advertising space on your website and then resell it without your approval. This can lead to spammy or malicious advertisements on your WordPress blog.

Here, an ads.txt file can help keep your site safe.

Ads.txt file stands for ‘Authorized Digital Seller.’ It was developed by IAB Tech Lab to help stop fraud in online advertising. In this file, you can list all the companies that have permission to sell advertising space on your website.

An ads.txt file is publicly available, so advertisers, publishers, and resellers can use it to check that they’re dealing with an approved company.

If you sell ads on your WordPress blog using Google Adsense, DoubleClick, or Ad Exchange, then we recommend adding an ads.txt file to your site.

With that being said, let’s see how you can create and manage an ads.txt file in WordPress.

How to Create and Manage Ads.txt Files in WordPress

The easiest way to create an ads.text file is by using Ads.txt Manager. This free plugin adds a simple code editor where you can type in all your authorized platforms and networks.

The first thing you need to do is install and activate the Ads.txt Manager plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, head over to the Settings » Ads.txt page.

Creating an ads.txt file for your WordPress website

This opens a simple code editor where you can add each platform or reseller on its own line. For example, here we’re adding Google AdSense as an approved advertising platform:, pub-0000000000000000, DIRECT, f08c47fec0942fa0

The first field is the domain of the company that is allowed to sell or resell your ad inventory. In the above example, that’s

After that, you’ll add the publisher ID, which is unique to your account. If you’re not sure where to find this ID, then you can check the network or platform’s online documentation for more information.

The third section declares the relationship type, which is either DIRECT or RESELLER. Direct means the publisher works directly with the AdTech vendor. Meanwhile, reseller means the publisher has authorized a third party to resell on their behalf, such as an ad network or ad management solution.

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

You can now add as many platforms and resellers as you want. Simply add each organization on its own line.

When you’re happy with the information you’ve entered, click on the ‘Save Changes’ button.

Publishing an ads.txt file on your website or blog

Now, anyone can read your site’s ads.txt file.

To see the file in action, simply add ads.txt to the end of your domain name, such as

An example of an ads.txt file in WordPress

Fixing the ‘Earnings at risk Error’ in Adsense

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

Earnings at risk – One or more of your ads.txt files doesn’t contain your AdSense publisher ID. Fix this now to avoid severe impact to your revenue.

This just means your ads.text file doesn’t have the right publisher ID.

To fix this issue, log into your AdSense page using your Google email address and password. You’ll find the ID next to the following field: ‘This email is associated with the AdSense account.’

The Google AdSense advertising platform

Now, simply go to Settings » Ads.txt in your WordPress dashboard and find the line that adds Google AdSense as an authorized provider.

You can now change the text so that it uses the right ID.

After that, don’t forget to click on ‘Save Changes’ to store your settings. Now if you visit your Google AdSense account again, the error message should have disappeared.

We hope this tutorial helped you learn how to create and manage ads.txt files in WordPress. You may also want to learn how to increase your blog traffic or check out our expert pick of the best WordPress popup plugins.

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

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

95 CommentsLeave a Reply

  1. Hello i installed Manage Ads.txt and i have google adsense and taboole my question

    can i use both in this plugin in one place

  2. Very nice article but I want to know how I can add more than one ads.txt file in root folder of my domain , lets say one from google and other from infolink? Please help

    • You should be able to add the information from one ads.txt file to the other and merge them for what you’re wanting to do :)


  3. You guys makes everything so simple! Thanks a million!! I just uploaded Ads.txt file into my site!!

  4. Hello,
    I have installed more than 10 plugins I don’t want to install more than that. I there any alternate option?

    • If you do not have an ads.txt file then you can create one, not all sites have one created for them by default.


  5. I worked with infolink before with this plugin. It worked properly. Now got adsense approval too. So need to add adsense ads.txt code to here. Without losing infolink can I add that file too?

  6. I do want to insert ads text on my wordpress website and will this work or is there any other recommendation to carry out this action.

    • You would want to check with who you are wanting to include ads from for how to add those to your site. This guide is to help limit what can include ads on your site rather than adding more to your site.


  7. i have added ads.txt from google adsense, and now i need to add ads.txt from another site and in file manager it refuses to create another ads.txt file, what can i do ?

    • Rather than creating another, you would want to modify your ads.txt with the recommendations from the different platforms you want to include.


  8. Very helpful, the plug-in was very easy to install and use.
    One question: now that my Ads.txt file is installed and running smooth on my site, is it okay to delete the plugin? Or would doing that also delete the Ads.txt file? I ask only because I try to minimize the number of plugins on my site, since each extra plugin makes the site that little bit heavier/slower etc.
    Thanks again.

  9. Wow! I’ve been trying to figure this out for almost an hour now! This article totally saved me! Thanks!

  10. Hey there,

    I am getting an error regarding there already being an ads.txt file on my wordpress, although there shouldn’t be? Strange.

    • You may want to check with your hosting provider to ensure there was no hiccup from their end.


  11. Thank for sharing the article, i,m also facing the same issues.

    I just want to know that, i have to update same code or need to do any change., pub-0000000000000000, DIRECT, f08c47fec0942fa0

  12. Always helpful, always to the point, thats why any time I need help I use wpbeginner.
    Thank you so much!

    Vana Verouti

  13. If i upload txt file in file manager on my control panel instead adding new plugin compare to add a plugin and put code in it, would it have same speed for loading my website or is it that plugin based set up affect the speed?

  14. My team and I just got our AdSense approved. We installed the Ads.txt plugin but I noticed all our articles had a change in their URLs.

    On tracing it, I saw that that ads.txt code of “, pub-account, DIRECT, blah blah blah” is being added to every of our post URL making it look like “, pub-account, DIRECT, blahblabhblah/post-name/

    It really looks disturbing.
    Please, how can I remove it without disturbing the ads.txt?

    • The ads.txt shouldn’t modify your permalinks, you would want to start by checking your permalink settings under Settings>Permalinks to see what is set there as well as resaving your permalinks


  15. i got approved, and i had the warning, i quickly installed and activated the plugin and the warnings disappeared. But days later, my ads stopped showing on my site (it wasn’t a ban or suspension). it just leaves blank ads spaces. The thing now is that the ads show sometimes, and most times it doesn’t which has made my earnings very poor.

    • For what it sounds like, you would want to use Google’s ads not displaying troubleshooter to see if there are any issues, otherwise, it could be there are no recommended ads to match the content on your site.


    • Yes, you would manually upload the ads.txt file to your site using either your host’s file manager or FTP and you could create the file using notepad or a similar text editor.


  16. Hey, I have added it like it states in this article, but when I go to google ad sense it says the same earnings at risk message. How do I resolve this?

    • You may need to give some time for Google’s cache to clear so it recrawls your site


  17. Thank you so much. I had no idea why my ads had gone blank. After adding ads.txt everything is working fine.

  18. Nice article, really helpful but will the Ads.txt plugin be automatically added to my site’s root domain? i mean, it seems really simple. Are you saying all i need to do i download the plugin, copy the google code, replace the pub id with mine and save changes. What about adding the txt file to the root domain? Will the plugin do that automatically?

  19. Hello,
    We have 2 google adsense accounts how to add both of them. I add two lines :, pub-first-account, DIRECT, f08c47fec0942fa0, pub-second-account, DIRECT, f08c47fec0942fa0

    or how ?

    Thank you

    • You’re correct, that would be how to add a second accepted advertiser on your site


  20. Thanks for your article. I was able to add Ads.txt on my website using the plugin recommended. But, Google Adsense is still not showing on my website; its still blank as before. What could be the problem?

    • There are a few possible reasons for ads not showing, if Google hasn’t recrawled your site that could be the simplest. Otherwise, you would want to go through their troubleshooter for the cause and fixing the issue.


  21. Thank you for your explanations. I was able to add Ads.txt on my website using the plugin recommended. But, Google Adsense is still not showing on my website. What could be the problem?

    • The most common reason is either your site’s caching or if your robots.txt may be preventing the file from being crawled. Google does take time to recrawl your site as well.


  22. i hv domain and subdomain too, how can i fix this, as u hv been told it would work on main domain only.

    • For the subdomains, you would need to manually create an ads.txt file and in your primary domain, note the subdomain for your site.


      • I hv 2 adsense, one for main domain and another for subdomain. Now I hv addeed txt file for main domain adsense only. Can i add both publishers id in one txt file.

        • You could add both publisher ids to the ads.txt file but you would want to make sure the correct id is in the subdomain’s file.

  23. Thanks. For a novice like me, you have been a great help in setting up my website.
    The most important thing is that your information is always to the point, and trustworthy. Whenever I face any problem, I search on your website. And if I have found what I am searching for, I know that my problem will now be definitely resolved.

  24. Hii, nice information. I had applied this procedure but it was still showing the same message. What was the issue.

    • If you just added the ads.txt then you would need to wait for Google to recrawl your site for the error to disappear.


  25. So done all of that and still showing in my adsense same warning. I am sure it will update soon and thank you for this simple to follow guide.

  26. Im geting errors with my site

    Im told html corrupt after visiting
    Please help
    Ads are still not showing after 48hours

    • you may want to try disabling any caching plugin on your site, if that resolves the issue you would want to exclude your ads.txt from your caching plugin.


      • Thanks for the advice
        I’m no longer getting html corrupt after visiting the ads.txt

        I went to exclude and entered the link above
        I’m so grateful

        I only hope my ads will start showing after 24hours

        Thanks again

  27. I recently used ads.txt plugin to install ads.txt file to my website I made all the changes as instructed but still my ads.txt page is showing blank. Can you please check and revert ASAP or can I use another plugin to make things live?

  28. Is there a ‘No-Plugin’ way of doing this thing.

    Everytime there is an update for something, a plug-in pops up out of nowhere as a solution.

  29. I have a normal Adsense approved website, so should I add Ads.txt file to it ? Is it important?

    • Hi Fahad,

      It is not required but recommended. It is important as some advertisers may not want their ads to appear on websites with no ads.txt file which could affect your website’s earning potential.


        • Some people absorb lessons better if they can watch it in a video, we understand wanting all of our articles in video form :)

  30. Great article. I’ve been getting this message on my Google Adsense account.

    The strange thing is that when I click on the link Google gives me, it’s not my website, but a big gaming site named . So, I’m not too sure why it’s telling me to fix my ads.txt file when it’s in the correct order, and indicating the incorrect domain.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.