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

Come creare e gestire i file Ads.txt in WordPress

Proteggere il vostro sito WordPress dalle frodi pubblicitarie è fondamentale, ma non deve essere complicato. Il file ads.txt è uno strumento semplice ma potente che può salvaguardare i vostri introiti pubblicitari e la vostra reputazione.

Siamo presenti nella Community di WordPress da oltre un decennio, aiutando i proprietari di siti come voi nella navigazione delle complessità della pubblicità online. Abbiamo visto più volte come l’implementazione di un file ads.txt possa fare la differenza.

In questa guida vi illustreremo due metodi semplici per creare e gestire un file ads.txt in WordPress.

How to create and manage ads.txt files in WordPress

Perché creare e gestire i file Ads.txt in WordPress?

Ads.txt è l’abbreviazione di “Authorized Digital Seller”. È un file che mostra quali aziende sono autorizzate a vendere annunci sul vostro sito WordPress e aiuta a impedire la comparsa di annunci falsi.

Se si guadagna con gli annunci (come con Google AdSense), è una buona idea aggiungere un file ads.txt al proprio sito web.

Il motivo è che alcune parti non autorizzate possono fingere di avere il vostro permesso per vendere annunci sul vostro blog WordPress. Questo potrebbe portare a mostrare annunci sbagliati o fuorvianti, il che può essere pericoloso per la vostra reputazione e per la sicurezza dei vostri utenti.

Il file ads.txt è come una guardia. Impedisce a chiunque non sia presente nel vostro elenco approvato di vendere annunci sul vostro blog WordPress. In questo modo, proteggerete il vostro sito web e vi assicurerete che vengano visualizzati solo gli annunci di partner fidati.

Tenendo presente questo, vediamo come creare e gestire un file ads.txt in WordPress. Vi illustreremo due metodi diversi. Potete utilizzare questi collegamenti rapidi per passare a uno specifico metodo:

La creazione e la gestione di un file ads.txt richiede un po’ di codice. Se non vi sentite a vostro agio con l’aggiunta di codice personalizzato, questo processo può sembrare eccessivo.

Ecco perché vi consigliamo di utilizzare WPCode, il miglior plugin di snippet di codice sul mercato. In questo modo, non dovrete intervenire direttamente sul codice di WordPress e preoccuparvi di rompere il vostro sito web.

Questo plugin agisce come un’interfaccia di facile utilizzo in cui è possibile inserire in modo semplice e sicuro il codice personalizzato nel proprio sito web WordPress. È possibile visualizzare tutti i codici aggiunti in un unico posto, in modo da tenere traccia delle personalizzazioni.

WPCode - Best WordPress Code Snippets Plugin

Per questa guida, utilizzeremo la versione WPCode Pro. Sebbene esista un plugin WPCode gratuito, la funzione necessaria per gestire i file ads.txt è presente nella versione Pro.

Prima di tutto, procedete all’installazione di WPCode. Se avete bisogno di una guida, potete seguire la nostra guida passo-passo su come installare un plugin di WordPress.

Successivamente, assicurarsi di attivare la chiave di licenza di WPCode Pro. Basta andare su Code Snippets Impostazioni e inserire la chiave di licenza dove necessario. Quindi, selezionare il pulsante “Attiva chiave”.

L’attivazione è avvenuta con successo quando il testo del pulsante diventa “Disattiva chiave”.

Enter WPCode license key

Ora, andiamo su Code Snippets File Editor. Qui si vedrà che il plugin ha già una funzione di gestione degli ads.txt incorporata.

A questo punto è necessario scrivere le seguenti informazioni in questo formato: dominio, ID pubblicato, tipo di relazione e ID della piattaforma pubblicitaria (opzionale).

Ad esempio, stiamo aggiungendo Google AdSense come piattaforma pubblicitaria approvata:

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Il primo campo è il dominio dell’azienda autorizzata a vendere o rivendere il vostro inventario di annunci. Nell’esempio precedente, si tratta di google.com.

Successivamente, si aggiungerà l’ID editore, che è unico per il proprio account. In questo caso, si tratta di pub-0000000000000000. Se non siete sicuri di dove trovare questo ID, potete consultare la documentazione online della rete o della piattaforma per maggiori informazioni.

Assicuratevi di aver inserito correttamente l’ID. In caso contrario, si potrebbe incorrere nell’errore “Guadagni a rischio”.

La terza sezione dichiara il tipo di relazione, che può essere DIRETTA o RESELLER. Diretto significa che l’editore lavora direttamente con il fornitore di AdTech.

Nel frattempo, per rivenditore si intende che l’editore ha autorizzato una terza parte a rivendere per suo conto, ad esempio una rete pubblicitaria o una soluzione di gestione degli annunci.

L’ultimo campo è l’ID della piattaforma pubblicitaria, facoltativo.

Creating ads.txt file with WPCode

Ora è possibile aggiungere tutte le piattaforme e i rivenditori desiderati. Assicuratevi di aggiungere ogni organizzazione sulla propria riga.

Una volta terminato, è sufficiente scorrere verso il basso e fare clic su “Salva modifiche”.

Saving the ads.txt file on WPCode

Ora chiunque può leggere il file ads.txt del vostro sito.

Per vedere il file in azione, basta aggiungere ads.txt alla fine del nome del dominio, ad esempio www.example.com/ads.txt.

An example of an ads.txt file in WordPress

Metodo 2: Creare un file Ads.txt in WordPress utilizzando Ads.txt Manager (gratuito)

Un altro modo per creare un file ads.text è utilizzare Ads.txt Manager. Questo plugin gratuito aggiunge un semplice editor di codice in cui è possibile inserire tutte le piattaforme e le reti autorizzate.

La prima cosa da fare è installare e attivare il plugin Ads.txt Manager. Per maggiori dettagli, consultate la nostra guida passo-passo su come installare un plugin di WordPress.

Dopo l’attivazione, accedere alla pagina Impostazioni ” Ads.txt.

Creating an ads.txt file for your WordPress website

In questo modo si apre un semplice editor di codice in cui è possibile aggiungere i dettagli di ogni piattaforma o rivenditore sulla propria riga, proprio come in precedenza.

Quando si è soddisfatti delle informazioni inserite, fare clic sul pulsante “Salva modifiche”.

Publishing an ads.txt file on your website or blog

Come risolvere l’errore di guadagno a rischio in Google AdSense

Se si utilizza Google AdSense, è possibile che venga visualizzato il seguente errore nel proprio account AdSense:

Guadagni a rischio - Uno o più file ads.txt non contengono il vostro ID editore AdSense. Risolvete subito questo problema per evitare un grave impatto sulle vostre entrate.

Ciò significa che il file ads.txt non contiene l’ID editore corretto.

Per risolvere questo problema, accedere alla pagina AdSense utilizzando l’indirizzo e-mail e la password di Google. Troverete l’ID accanto al seguente campo: “Questa e-mail è associata all’account AdSense”.

The Google AdSense advertising platform

A questo punto, basta andare nell’editor di file di WPCode o nel gestore di Ads.txt e trovare la riga che aggiunge Google AdSense come fornitore autorizzato. Quindi, modificate il testo in modo che utilizzi l’ID corretto.

Quindi, salvare le modifiche per memorizzare le impostazioni. Ora, se visitate nuovamente il vostro account Google AdSense, il messaggio di errore dovrebbe essere scomparso.

Massimizzate il potenziale pubblicitario di WordPress

Volete portare la vostra strategia pubblicitaria su WordPress al livello successivo? Verificate queste utili risorse:

Speriamo che questo tutorial vi abbia aiutato a imparare a creare e gestire i file ads.txt in WordPress. Potreste anche voler imparare come gestire gli annunci in WordPress con il plugin AdSanity e il nostro elenco delle dimensioni dei banner Google AdSense più performanti.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

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.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

103 commentiLascia una risposta

  1. Syed Balkhi

    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. Amber

    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

      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.

      Admin

  3. Poornapragna G A

    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

      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.

      Admin

  4. Ismail

    Will this ” f08c47fec0942fa0″ be unique to all advertisers in my website?

    • WPBeginner Support

      Yes the ad code will be specific to the advertisers :)

      Admin

  5. Caydaruus

    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

    • WPBeginner Support

      Unless we hear otherwise, you should be able to add both using this plugin.

      Admin

  6. Rakesh

    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

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

      Admin

  7. Poorna

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

  8. Arif Wali

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

  9. Jem

    Followed everything but when time to check it appears cannot be found. what should I do?

    • WPBeginner Support

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

      Admin

  10. Sasindu Jayasri

    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?

    • WPBeginner Support

      You would add the new information on a new line of your ads.txt file.

      Admin

  11. Emmanuel Acquah

    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

      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.

      Admin

  12. mohamed salah

    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

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

      Admin

  13. Bhuvana M J

    Thanks, it is very helpful

    • WPBeginner Support

      You’re welcome :)

      Admin

  14. Paula

    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.

  15. Carmen Applegate

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

    • WPBeginner Support

      Glad our article was helpful :)

      Admin

  16. WILLIAM

    This page has saved my bacon on more than one occasion, thank you.

    • WPBeginner Support

      You’re welcome, glad our guide could assist you :)

      Admin

  17. Stephen Reeves

    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

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

      Admin

  18. Rakib

    Thanks For share with us it”s Very helpful for beginner.
    Thank You a lot !!!

    • WPBeginner Support

      Glad you found our content helpful :)

      Admin

  19. Ashish Gupta

    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

    • WPBeginner Support

      You need to replace the pub-0000000000000000 with your own publisher ID

      Admin

  20. Vana

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

    Vana Verouti

    • WPBeginner Support

      Thank you, glad our content can be helpful :)

      Admin

  21. Karnav

    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?

    • WPBeginner Support

      The speed difference shouldn’t be noticeable between the two methods

      Admin

  22. Mae Orcales

    Thanks, you’ve always been a great help!

    • WPBeginner Support

      Glad our guides have been helpful :)

      Admin

  23. Samson

    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

      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

      Admin

  24. Swarupa...

    wpbeginner,

    You are a savior. You have answers to all my questions.

    Thanks a lot

    • WPBeginner Support

      Glad we can help answer your questions :)

      Admin

  25. vuctor

    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

      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.

      Admin

  26. Francisca

    Is there any way this can be done without a plugin?

    • WPBeginner Support

      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.

      Admin

  27. Pardeep

    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?

    • WPBeginner Support

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

      Admin

  28. Nikhil Kumar

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

    • WPBeginner Support

      Glad our guide could help solve the problem

      Admin

  29. Ajibade Victor

    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?

    • WPBeginner Support

      Yes, the plugin should create that file and place it for you :)

      Admin

  30. Simon Pan

    Thanks for your article

    • WPBeginner Support

      You’re welcome, glad you like our article :)

      Admin

  31. Dina

    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

    • WPBeginner Support

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

      Admin

  32. Nitesh

    I am searching for this tactics long time. Thanks for sharing with us.

    • WPBeginner Support

      You’re welcome, glad our article could be helpful :)

      Admin

  33. MicroDok

    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

      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.

      Admin

  34. Emmanuel Peter

    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

      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.

      Admin

  35. pawan

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

    • WPBeginner Support

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

      Admin

      • Pawan

        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

          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.

  36. Irfan Ahmed

    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.

    • WPBeginner Support

      Glad our guides could be helpful :)

      Admin

  37. Belmadeng

    Thanks for sharing this guide. It was really helpful

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  38. Favour

    The Plugin says; Untested with your version of WordPress, any other way?

  39. Ajay

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

    • WPBeginner Support

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

      Admin

  40. Philip

    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.

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  41. Edem Buameh

    Im geting errors with my site

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

    • WPBeginner Support

      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.

      Admin

      • EDEM BUAMEH

        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!

        • WPBeginner Support

          Glad our recommendation could help :)

  42. Jimy

    Thank you very much. I thought I needed to ad another page to the site.

    • WPBeginner Support

      Glad our article could help :)

      Admin

  43. barbara

    This was super helpful! Thanks!

    • WPBeginner Support

      Glad our article could be helpful :)

      Admin

  44. James Parry

    Thank you, really helpful when I got a little lost in the process.

  45. Amby

    I did as instructed and two days later I’m getting the same warning from Adsense. :/

  46. HENRY

    Nice, i was looking for this plugin, so i do this..is easy. Thanks for the help.

  47. Mani

    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?

  48. Rajat Chakraborty

    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.

  49. George

    Bizarre that one would need a plugin for something so stupidly simple trivial!

  50. Fahad Ur Rehman Khan

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

    • WPBeginner Support

      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.

      Admin

      • Fahad Ur Rehman Khan

        Can you please make a video tutorial on it ?

        • OJ

          What do you need a video for?
          Man, this article is self explanatory.

        • WPBeginner Support

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

  51. Daniel Taylor

    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.

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.