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

Il modo giusto per rimuovere il numero di versione di WordPress

Nota editoriale: guadagniamo una commissione dai link dei partner su WPBeginner. Le commissioni non influenzano le opinioni o le valutazioni dei nostri redattori. Per saperne di più su Processo editoriale.

Volete rimuovere il numero di versione di WordPress dal vostro sito web?

Molti ritengono che la rimozione del numero di versione di WordPress dal codice sorgente del sito web possa prevenire alcuni comuni attacchi online.

In questo articolo vi mostreremo come rimuovere facilmente il numero di versione di WordPress nel modo giusto.

Hiding WordPress version number from your website

Perché rimuovere il numero di versione di WordPress?

Per impostazione predefinita, WordPress lascia le sue impronte sul vostro sito a scopo di tracciamento. È così che sappiamo che WordPress è il miglior costruttore di siti web al mondo.

WordPress version shown in source code by default

Tuttavia, a volte questa impronta potrebbe rappresentare una falla nella sicurezza del vostro sito se non state utilizzando la versione più aggiornata di WordPress. Fornisce all’hacker informazioni utili indicando la versione in uso.

Gli hacker spesso prendono di mira vulnerabilità di sicurezza note in versioni specifiche del software. Nascondendo il numero di versione di WordPress, rendete leggermente più difficile per gli aggressori determinare quale versione di WordPress è in esecuzione sul vostro sito.

Vi consigliamo di utilizzare l’ultima versione di WordPress su tutti i vostri siti web, in modo da non dovervi preoccupare di questo problema. Tuttavia, se per qualche motivo state utilizzando una versione precedente di WordPress, dovete assolutamente seguire questa guida.

È piuttosto difficile rimuovere tutte le tracce della versione di WordPress in uso sul vostro sito web. Un attacco sofisticato potrebbe comunque essere in grado di trovare queste informazioni.

Tuttavia, impedirà agli scanner automatici e ad altri tentativi meno sofisticati di indovinare la versione di WordPress.

Detto questo, vediamo alcuni modi per rimuovere facilmente il numero di versione dal vostro sito WordPress.

Metodo 1. Rimuovere le informazioni sulla versione di WordPress con il codice (consigliato)

Questo metodo richiede l’aggiunta di codice al vostro sito WordPress. Se non l’avete mai fatto prima, consultate la nostra guida su come copiare e incollare snippet di codice in WordPress.

Molti siti web consigliano di modificare il file header.php del tema e di eliminare la seguente riga di codice:

<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />

Questo metodo non funziona perché un nuovo aggiornamento del tema sostituisce automaticamente il vecchio modello con il nuovo file.

Un altro metodo comunemente consigliato, ma inefficiente, è quello di inserire questo codice nel functions.php del tema:

remove_action('wp_head', 'wp_generator');

Questo rimuoverà solo le informazioni dall’intestazione di WordPress. Il numero di versione sarà ancora visibile nei feed RSS del sito.

Il modo corretto per rimuovere le informazioni sulla versione di WordPress è disabilitare la funzione responsabile della loro visualizzazione.

Per rimuovere completamente il numero di versione di WordPress dal file di intestazione e dai feed RSS, è necessario aggiungere il seguente codice al plugin Code Snippets.

function wpbeginner_remove_version() {
return '';
}
add_filter('the_generator', 'wpbeginner_remove_version');

Per rendere il tutto ancora più semplice, è possibile utilizzare WPCode, il miglior plugin di snippets di codice per WordPress.

WPCode ha una libreria di codice integrata che contiene tutti i più popolari snippet di codice di WordPress, compreso uno snippet per rimuovere il numero di versione di WordPress.

Per iniziare, è necessario installare e attivare il plugin gratuito WPCode. Per istruzioni dettagliate, consultare la nostra guida su come installare un plugin di WordPress.

Una volta attivato il plugin, andate su Code Snippets Library dalla vostra dashboard di WordPress.

Quindi, cercate lo snippet “Rimuovi il numero di versione di WordPress” e fate clic sul pulsante “Usa snippet”.

Select the Remove WordPress Version Number snippet in WPCode

WPCode aggiungerà automaticamente il codice, aggiungerà un titolo al codice e imposterà il metodo di inserimento corretto.

Aggiungerà anche dei tag per aiutarvi a organizzarli.

WPCode Remove WordPress Version code snippet

È sufficiente passare da “Inattivo” ad “Attivo”.

Quindi, fare clic sul pulsante “Aggiorna”.

Switch the code snippet to Active and click Update in WPCode

Ora il numero di versione di WordPress sarà nascosto dal frontend del sito e dai feed RSS.

Metodo 2. Rimuovere il numero di versione di WordPress con Sucuri

Tutti i migliori plugin di sicurezza per WordPress offrono un’opzione nelle impostazioni per nascondere il numero di versione di WordPress.

Tuttavia, consigliamo di utilizzare Sucuri perché nasconde automaticamente le informazioni sulla versione di WordPress e offre altre funzioni di sicurezza più avanzate.

Inoltre, Sucuri fornisce un firewall che filtra e monitora il traffico HTTP, bloccando le minacce dannose prima che raggiungano il vostro server web. Se rileva codice dannoso, consente di ripulire il sito web, rimuovendo le minacce nel processo.

È sufficiente installare e attivare il plugin Sucuri. Per maggiori dettagli, consultate la nostra guida passo passo su come installare un plugin di WordPress.

All’attivazione, il plugin nasconde automaticamente le informazioni sulla versione di WordPress. È possibile verificarlo visitando Sucuri Security ” Settings e passando alla scheda Hardening.

Sucuri WordPress version hardening

Potreste anche essere interessati al nostro post sul perché usiamo Sucuri per migliorare la sicurezza di WordPress qui a WPBeginner.

È possibile nascondere completamente la versione di WordPress?

WordPress può comunque aggiungere le informazioni sulla versione in vari altri punti del sito.

Ad esempio, è incluso come stringa di query nel codice sorgente dei file CSS e JS.

WordPress version shown with CSS and JS files

La rimozione di tutte le istanze delle informazioni sulla versione di WordPress può richiedere molto tempo, essere complicata e non sempre funzionare.

Dal punto di vista della sicurezza, la rimozione degli ovvi tag del generatore può proteggere da alcuni attacchi molto comuni.

Tuttavia, se qualcuno è determinato a penetrare nel vostro sito web, nascondere il numero di versione di WordPress non serve a molto.

Per rendere più sicuro il vostro sito web, dovete implementare una corretta configurazione di sicurezza di WordPress. In questo modo si aggiungono strati di sicurezza intorno al vostro sito web, rendendolo più difficile da violare.

Inoltre, è necessario scegliere il miglior provider di hosting WordPress per il proprio sito web, poiché un hosting web insicuro è vulnerabile ai tentativi di hacking.

Speriamo che questo articolo vi abbia aiutato a capire come nascondere facilmente il numero di versione di WordPress dal vostro sito web. Potreste anche consultare la nostra guida su come ottenere un certificato SSL gratuito per il vostro sito web o il nostro elenco di plugin WordPress indispensabili per le piccole imprese.

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

65 commentiLascia una risposta

  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

    Sometimes it fascinates me how many details can be done, e.g. in terms of security, that I would not have thought of. So I removed the WordPress version from the website according to your instructions.

  3. Ashkan says

    function wpbeginner_remove_version()
    what should we write instead of “wpbeginner” _remove_version?
    a specific file name or our website name or what?

    • WPBeginner Support says

      This is to remove the version number from the HTML header, if you want to remove the text that you are using WordPress then you would want to reach out to your specific theme’s support.

      Admin

  4. Abhishek says

    i have added this line in functions.php, but wapplyzer can still detect the version
    remove_action(‘wp_head’, ‘wp_generator’);

  5. bayu says

    hy.. a practice that is still usable ? I want to ask, how to hide the plugin that we use information from view page source and various wordpress detector … thanks alot.

  6. Ragoco says

    Will this prevent WordPress from auto-detect and notify me about new versions, so that i can update? Thanks

  7. Chris Copland says

    For those like me who have read this to the bottom looking for a definitive answer only to be left wanting despite all the possibilities no one has Identified a solution that works for everyone.

    I suggest you load WordPress in Wamp or similar and check every possibility.

    How about the editorial staff have a look remove…remove the wheat from the chaff and re-post
    The Right Way To Remove WordPress Version Number?

  8. nicmare says

    why so complicated? make it easy:
    // remove wp version
    add_filter(‘the_generator’, ‘__return_false’);

  9. Dan says

    Maybe I’m missing something here, but adding the filter does remove the version number but fails to remove it from the end of some of the styles sheets and a few .js files as well from plugins. i.e.

    ….css?ver=3.8.1′ type=’text/css’ media=’all’ />

    Anyway to remove those as well?

    Thanks

  10. Alys says

    Hi

    none of these methods work with WP 3.8/ RC2

    I put the code:

    function wpbeginner_remove_version() {
    return ”;
    }
    add_filter(‘the_generator’, ‘wpbeginner_remove_version’);

    in the bottom of my functions.php file. No effect.

    Here is a sample of the scripts loading when I look at the source code, and you can see the wp ver is still tacked onto the end….

    I tried some of the other code suggestions in this thread, and none of them worked either.

    Perhaps I am doing something wrong?

    Many thank in advance for your suggestions.

    As you can see it is still showing at the end of each.

  11. Dave says

    It should also be mentioned that if you want to hide the number, you should also get rid of the readme.html file that accompanies WordPress, as it displays the version in big giant numbers right at the top of the page. Last I read, it also hides in a JavaScript file somewhere as well, but I’m not sure which one.

  12. Jeremy Simkins says

    I use this to remove the WordPress version.

    ‘remove_action(‘wp_head’, ‘wp_generator’); // Remove WordPress version from site’

  13. Matthew Shuey says

    This is arguably on of the most useful code snippets ever. Plugins break so this is a perfect way to remove the generator meta tag from WordPress.

  14. techispot says

    Sorry to say it is not working with feed, I means it not remove version number from feed, I personally add the function you specified , it remove from my home page source but not from rss page source, you can view my rss page source it is still there http://www.techispot.com/feed

    Any one find solution please share

  15. brasofilo says

    i wanted to keep the generator without the version number, so i’m returning instead of an empty string…

    is this correct?

  16. Nacin says

    Removing the generator code has nothing to do with security, frankly. If someone is targeting your site in particular, there are other effective ways to determine a version number. If it’s just a malicious script, it’s going to try every exploit that has ever worked regardless of your version. Indeed, we have never seen an exploit script attempting to do version detection.

    Also, the statement “While plugins are great, they somewhat slow your site down,” is a bit misleading in this context, I feel. Yes, a lot of plugins that do heavy-lifting will increase drag on a server. But a good amount of core uses the Plugin API to hook into itself, using the same methods as a plugin. And adding this code to functions.php is doing the same thing.

    • Roger Ruz says

      “Also, the statement “While plugins are great, they somewhat slow your site down,” is a bit misleading in this context, I feel. ”

      Nice argument! I’m researching on how to remove plugin scripts that are not necessary/not in use to a page but being requested every time in the server.

  17. Ray says

    Realized that the “Secure WordPress” plugin already does that for you and more. Assuming most people would be interested in securing their WordPress (not just hiding the version number), it would be better to make use of that plugin to do all these for you.

    Incidentally, I got to know of the Secure WordPress plugin via wpbeginner. https://www.wpbeginner.com/wp-tutorials/11-vital-tips-and-hacks-to-protect-your-wordpress-admin-area/

    Nice work guys! Keep on writing!

    • Editorial Staff says

      While plugins are great, they somewhat slow your site down. Why use a plugin if it can be done with a simple function in your functions.php file. But yes Secure WordPress plugin does that as well on all versions older than 2.4.

      Admin

      • Ray says

        Would have to agree with you on that: just modding the functions.php would be more efficient than adding a plugin just to remove the version number.

      • Nick says

        Ok the error was mine, I was modifying the wrong function.php file.
        The correct one is function.php inside the theme directory and not the one in the core.

        Thank you!!!

  18. Nick says

    It’s strange, it gives me the error:
    Call to undefined function: add_filter()

    But I’ve checked the plugin.php file and I have obviously the add_filter() funciont defined.

    Any suggestion? Ths.

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.