Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coupe WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Comment créer et gérer les fichiers Ads.txt dans WordPress

Note éditoriale : Nous percevons une commission sur les liens des partenaires sur WPBeginner. Les commissions n'affectent pas les opinions ou les évaluations de nos rédacteurs. En savoir plus sur Processus éditorial.

Voulez-vous créer et gérer un fichier ads.txt dans WordPress ?

Si votre site se fait piéger par des annonces frauduleuses, cela peut nuire à votre réputation et vous coûter de l’argent. En ajoutant un simple fichier ads.txt à votre site, vous pouvez protéger votre site, vos partenaires et vos éditeurs contre la fraude publicitaire et éventuellement augmenter vos recettes publicitaires.

Dans cet article, nous allons vous afficher comment créer et gérer facilement un fichier ads.txt dans WordPress.

How to create and manage ads.txt files in WordPress

Pourquoi créer et gérer des fichiers Ads.txt dans WordPress ?

L’abréviation Ads.txt signifie « Authorized Digital Seller » (vendeurs numériques autorisés). Il s’agit d’un fichier qui affiche les entreprises autorisées à vendre des publicités sur votre site WordPress et qui aide à empêcher l’apparition de fausses publicités.

Si vous gagnez de l’argent en bloguant grâce aux publicités (comme avec Google Adsense), c’est une bonne idée d’ajouter un fichier ads.txt à votre site.

La raison en est que certaines parties non autorisées peuvent prétendre avoir votre droit de vendre des publicités sur votre blog WordPress. Cela pourrait prospecter à afficher des publicités mauvaises ou trompeuses, ce qui peut être dangereux pour votre réputation et la sécurité de vos utilisateurs/utilisatrices.

Le fichier publicités.txt est comme un gardien. Il empêche toute personne ne figurant pas sur votre liste approuvée de vendre des publicités sur votre blog WordPress. De cette façon, vous sécuriserez votre site et vous vous assurerez que seules les publicités des partenaires de confiance s’affichent réellement.

Ajouté à cela, nous allons voir comment créer et gérer un fichier ads.txt dans WordPress. Nous allons vous présenter deux méthodes différentes. Vous pouvez utiliser ces liens rapides pour aller à/au spécifique :

La création et la gestion d’un fichier ads.txt nécessitent un peu de codage. Si vous n’êtes pas à l’aise avec l’ajout de code personnalisé par vous-même, ce processus peut vous sembler insurmontable.

C’est pourquoi nous vous recommandons d’utiliser WPCode, qui est la meilleure extension d’extraits de code sur le marché. Grâce à lui, vous n’aurez pas à bricoler directement votre code WordPress et à vous inquiéter de casser votre site.

Cette extension agit comme une interface conviviale où vous pouvez facilement et en toute sécurité insérer du code personnalisé dans votre site WordPress. Vous pouvez voir tous les codes que vous avez ajoutés en un seul endroit afin que vous puissiez garder une trace de vos personnalisations.

WPCode - Best WordPress Code Snippets Plugin

Pour ce guide, nous utiliserons la version WPCode Pro. Bien qu’il existe une extension WPCode gratuite, la fonctionnalité dont nous avons besoin pour gérer les fichiers ads.txt se trouve dans la version Pro.

Tout d’abord, installez WPCode. Vous pouvez suivre notre guide étape par étape sur l ‘installation d’une extension WordPress si vous avez besoin de conseils.

Confirmez ensuite que vous avez activé la clé de licence de WPCode Pro. Allez simplement dans Extraits de code «  Réglages et insérez votre clé de licence à l’endroit approprié. Sélectionnez ensuite le bouton « Activer la clé ».

L’activation est bien réussie lorsque le texte du bouton se modifie en « Désactiver la clé ».

Enter WPCode license key

Maintenant, allons dans Extraits de code «  Éditeurs/éditrices de fichiers. Vous consulterez cette page pour constater que l’extension dispose déjà d’une fonctionnalité intégrée de gestion des publicités.txt avant.

Ce que vous devez faire maintenant, c’est écrire les informations suivantes dans ce format : domaine, ID publié, type de relation et ID de la plateforme publicitaire (facultatif).

Par exemple, nous ajoutons ici Google Adsense en tant que plateforme d’annonces approuvée :

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Le premier champ est le domaine de l’entreprise qui est autorisée à vendre ou à revendre votre inventaire publicitaire. Dans l’exemple ci-dessus, il s’agit de google.com.

Ensuite, vous ajouterez l’ID de l’éditeur, qui est unique à votre compte. Ici, il s’agit de pub-0000000000000000. Si vous ne savez pas trop où trouver cet ID, vous pouvez alors consulter la documentation en ligne du réseau ou de la plateforme pour plus d’informations.

Confirmez l’exactitude de l’ID. Dans le cas contraire, vous risquez d’être confronté à l’erreur « gains à risque ».

La troisième section déclare le type de relation, qui est soit DIRECT, soit RESELLER. Directe signifie que l’éditeur travaille directement avec le fournisseur AdTech.

Quant au revendeur, il signifie que l’éditeur a autorisé une tierce partie à revendre en son nom, comme un réseau publicitaire ou une solution de gestion publicitaire.

Le dernier champ est l’ID de la plateforme publicitaire, qui est facultatif.

Creating ads.txt file with WPCode

Vous pouvez désormais ajouter autant de plateformes et de revendeurs que vous le souhaitez. Confirmez simplement que vous ajoutez chaque organisation sur sa propre ligne.

Une fois que vous avez terminé, défilez vers le bas et cliquez sur « Enregistrer les modifications ».

Saving the ads.txt file on WPCode

Désormais, n’importe qui peut lire le fichier ads.txt de votre site.

Pour voir le fichier en action, il suffit d’ajouter publicités.txt à la fin de votre nom de domaine, par exemple www.example.com/ads.txt.

An example of an ads.txt file in WordPress

Méthode 2 : Créer un fichier publicités.txt dans WordPress en utilisant Ads.txt Manager (gratuit)

Une autre façon de créer un fichier ads.text est d’utiliser le Gestionnaire de publicités.txt. Cette extension gratuite ajoute un éditeur/éditrices de code simple où vous pouvez taper toutes vos plateformes et réseaux autorisés.

La première chose à faire est d’installer et d’activer l’extension Ads.txt Manager. Pour plus de détails, consultez notre guide étape par étape sur l’installation d’une extension WordPress.

Une fois activé, rendez-vous sur la page Réglages  » Annonces.txt.

Creating an ads.txt file for your WordPress website

Cela ouvre un éditeur/éditrices de code simple où vous pouvez ajouter les détails de chaque plateforme ou revendeur sur sa propre ligne, comme auparavant.

Lorsque vous êtes satisfait des informations saisies/saisie, cliquez sur le bouton « Enregistrer les modifications ».

Publishing an ads.txt file on your website or blog

Comment corriger l’erreur « Earnings at Risk » dans Google AdSense ?

Si vous utilisez Google AdSense, il est possible que l’erreur suivante apparaisse dans votre compte AdSense :

Revenus menacés - Un ou plusieurs de vos fichiers ads.txt ne contiennent pas votre ID d'éditeur AdSense. Corrigez ce problème dès maintenant afin d'éviter de graves répercussions sur vos revenus.

Cela signifie simplement que votre fichier ads.txt ne contient pas le bon ID d’éditeur.

Pour corriger ce problème, connectez-vous à votre page AdSense en utilisant votre adresse e-mail et votre mot de passe Google. Vous trouverez l’ID à côté du champ suivant : « Cet e-mail est associé au compte AdSense ».

The Google AdSense advertising platform

Maintenant, il suffit d’aller dans l’éditeur de fichiers de WPCode ou dans le gestionnaire Ads.txt et de trouver la ligne qui ajoute Google AdSense comme auteur/autrice. Modifiez ensuite le texte pour qu’il utilise le bon ID.

Ensuite, enregistrez votre modification pour stocker vos Réglages. Si vous consultez à nouveau votre compte Google AdSense, le message d’erreur devrait avoir disparu.

Nous espérons que ce tutoriel vous a aidé à apprendre comment créer et gérer des fichiers ads.txt dans WordPress. Vous voudrez peut-être aussi apprendre comment augmenter le trafic de votre blog ou consulter notre choix d’experts des meilleures extensions de fenêtres surgissantes WordPress.

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.

Divulgation : Notre contenu est soutenu par les lecteurs. Cela signifie que si vous cliquez sur certains de nos liens, nous pouvons gagner une commission. Consultez comment WPBeginner est financé, pourquoi cela compte et comment vous pouvez nous soutenir. Voici notre processus éditorial.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

L'ultime WordPress Toolkit

Accédez GRATUITEMENT à notre boîte à outils - une collection de produits et de ressources liés à WordPress que tous les professionnels devraient avoir !

Reader Interactions

103 commentairesLaisser une réponse

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    I was also initially alerted that I didn’t have an ads.txt file. However, I eventually chose the path of manually creating and uploading it via FTP to save WordPress from additional plugins. Therefore, I recommend the same. Alternatively, if anyone has a file manager in WordPress in the form of a plugin, they can simply create a text file named ads.txt with the code and upload it to the root directory of WordPress via FTP.

  3. Ahmed Omar says

    I just received this message few days ago « Earnings at risk – You need to fix some ads.txt file issues to avoid severe impact to your revenue. »
    This post solved my issue
    Thank you

  4. Amber says

    Hi,

    I have followed the steps to add the ad.txt to the website. When I go to check it is says page not found. I have deleted cache. I’m not sure what else to do.

    • WPBeginner Support says

      If clearing your site’s cache is not working, reach out to your hosting provider for them to make sure it is not their caching or a security setting that may be preventing it from being crawled.

      Administrateur

  5. Poornapragna G A says

    Hi,

    I have been a regular reader of your lovely blog. Thanks.

    I entered the details of Ads.txt as given in Google Adsense in the Ads.Txt section « Settings » section in the WordPress dashboard and saved the changes as per your guidance above. Still, my Adsense account says « Ads. Txt not found ». What is the reason for this?

    • WPBeginner Support says

      If you have any caching on your site, ensure that you clear it as that is the most common reason why Google would not be able to find your new ads.txt.

      Administrateur

  6. Caydaruus says

    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

  7. Rakesh says

    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

    • WPBeginner Support says

      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 :)

      Administrateur

  8. Arif Wali says

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

    • WPBeginner Support says

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

      Administrateur

  9. Sasindu Jayasri says

    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?

  10. Emmanuel Acquah says

    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.

    • WPBeginner Support says

      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.

      Administrateur

  11. mohamed salah says

    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 ?

    • WPBeginner Support says

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

      Administrateur

  12. Paula says

    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.

  13. Stephen Reeves says

    Hey there,

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

    • WPBeginner Support says

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

      Administrateur

  14. Ashish Gupta says

    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.
    google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

  15. Vana says

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

    Vana Verouti

  16. Karnav says

    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?

  17. Samson says

    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 « google.com, pub-account, DIRECT, blah blah blah » is being added to every of our post URL making it look like « www.example.com/google.com, pub-account, DIRECT, blahblabhblah/post-name/

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

    • WPBeginner Support says

      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

      Administrateur

  18. vuctor says

    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.

    • WPBeginner Support says

      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.

      Administrateur

    • WPBeginner Support says

      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.

      Administrateur

  19. Pardeep says

    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?

  20. Ajibade Victor says

    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?

  21. Dina says

    Hello,
    We have 2 google adsense accounts how to add both of them. I add two lines :

    google.com, pub-first-account, DIRECT, f08c47fec0942fa0

    google.com, pub-second-account, DIRECT, f08c47fec0942fa0

    or how ?

    Thank you

  22. MicroDok says

    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?

    • WPBeginner Support says

      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.

      Administrateur

  23. Emmanuel Peter says

    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?

    • WPBeginner Support says

      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.

      Administrateur

    • WPBeginner Support says

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

      Administrateur

      • Pawan says

        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.

        • WPBeginner Support says

          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.

  24. Irfan Ahmed says

    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.

  25. Ajay says

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

    • WPBeginner Support says

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

      Administrateur

  26. Philip says

    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.

  27. Edem Buameh says

    Im geting errors with my site

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

    • WPBeginner Support says

      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.

      Administrateur

      • EDEM BUAMEH says

        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
        Cheers!

  28. Mani says

    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?

  29. Rajat Chakraborty says

    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.

Laisser une réponse

Merci d'avoir choisi de laisser un commentaire. Veuillez garder à l'esprit que tous les commentaires sont modérés selon notre politique de commentaires, et votre adresse e-mail ne sera PAS publiée. Veuillez NE PAS utiliser de mots-clés dans le champ du nom. Ayons une conversation personnelle et significative.