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 aggiungere i tag Hreflang in 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 aggiungere i tag hreflang nei vostri post e pagine di WordPress? Se pubblicate contenuti in più lingue o per regioni diverse, il tag hreflang vi aiuta a migliorare la SEO per tali regioni e lingue. In questo articolo vi mostreremo come aggiungere facilmente i tag hreflang in WordPress senza scrivere una sola riga di codice.

How to add hreflang tags in WordPress

Che cos’è il tag hreflang?

Il tag hreflang consente di indicare ai motori di ricerca quale pagina mostrare per una particolare regione e lingua. È possibile utilizzarlo anche per definire altre varianti dello stesso contenuto in lingue diverse.

Ecco come si presenta un’implementazione del tag hreflang in HTML semplice.


<link rel="alternate" href="example.com" hreflang="en-us" />
<link rel="alternate" href="example.com/fr/" hreflang="fr-fr" />
<link rel="alternate" href="example.com/pt/" hreflang="pt-pt" />

Il tag hreflang è una combinazione del codice della lingua e del codice della regione. Ad esempio, en-us per l’inglese e gli Stati Uniti, fr-fr per il francese e la Francia, e così via.

WordPress è disponibile in più di 60 lingue ed è possibile utilizzare WordPress nella propria lingua.

Molti proprietari di siti WordPress si rivolgono a utenti di regioni e lingue diverse. Alcuni lo fanno creando siti web multilingue, mentre altri lo fanno offrendo alcuni contenuti in altre lingue.

I motori di ricerca possono facilmente rilevare la lingua di una pagina e abbinarla automaticamente alle impostazioni linguistiche del browser dell’utente. Tuttavia, le vostre pagine potrebbero comunque competere tra loro nei risultati di ricerca e ciò potrebbe influire sulla SEO del vostro sito.

Per risolvere questo problema è possibile implementare i tag hreflang. Vediamo come aggiungere facilmente i tag hreflang in WordPress.

Metodo 1: Aggiungere il tag hreflang in WordPress utilizzando un plugin multilingue

L’approccio migliore per creare un sito WordPress multilingue è l’utilizzo di un plugin multilingue. Un plugin WordPress multilingue consente di creare e gestire facilmente contenuti in più lingue utilizzando lo stesso software di base WordPress.

Questi plugin si occupano automaticamente di tutti gli aspetti tecnici, come il tag hreflang, in modo che possiate concentrarvi sulla creazione di contenuti.

Vi consigliamo di utilizzare Polylang. Si tratta di un plugin gratuito per WordPress, dotato di un’interfaccia molto potente e facile da usare per gestire i contenuti multilingue. Per istruzioni dettagliate, consultate la nostra guida su come creare facilmente un sito WordPress multilingue.

Adding languages in Polylang

Un’altra opzione popolare è WPML. Si tratta di un plugin premium per WordPress con un’interfaccia facile da usare per creare contenuti multilingue sul vostro sito web. Per istruzioni passo passo, consultate la nostra guida su come creare un sito WordPress multilingue con WPML.

Dopo aver creato alcuni post o pagine in più lingue, è necessario visitarli in una nuova finestra del browser. Fate clic con il tasto destro del mouse e selezionate “Visualizza origine pagina” dal menu del browser.

In questo modo si aprirà il codice sorgente del post o della pagina. Ora è necessario cercare il tag hreflang per verificare che funzioni correttamente. Potete anche usare i tasti CTRL+F (Command+F) per trovare il tag hreflang.

Metodo 2: Aggiungere i tag hreflang in WordPress senza usare un plugin multilingue

Questo metodo è destinato agli utenti che non utilizzano un plugin multilingue per gestire le traduzioni sui loro siti web.

La prima cosa da fare è installare e attivare il plugin HREFLANG Tags Lite. Per maggiori dettagli, consultate la nostra guida passo passo su come installare un plugin di WordPress.

Dopo l’attivazione, il plugin aggiungerà una nuova voce di menu denominata HREFLANG nel menu di amministrazione di WordPress. Facendo clic su di essa si accede alla pagina delle impostazioni del plugin.

hreflang tag plugin settings

Selezionate i tipi di post per i quali desiderate attivare il plugin e poi fate clic sul pulsante Salva modifiche per salvare le impostazioni.

Successivamente, è necessario modificare il post o la pagina in cui si desidera aggiungere il tag hreflang. Nella schermata di modifica del post, si noterà un nuovo metabox con l’etichetta HREFLANG tags.

Adding hreflang tags using a plugin

Per prima cosa è necessario aggiungere l’URL del post che si sta modificando e poi selezionare la sua lingua. Successivamente, è necessario fare clic sul pulsante più per aggiungere gli URL di altre varianti del post e la relativa lingua.

Una volta terminato, fare clic sul pulsante Salva o Aggiorna per salvare il post.

Ora è possibile visitare il post in una finestra del browser e visualizzarne il codice sorgente. Si vedrà il tag hreflang aggiunto al post.

Speriamo che questo articolo vi abbia aiutato a capire come aggiungere facilmente il tag hreflang al vostro sito WordPress. Potreste anche voler consultare la nostra guida passo passo sulla SEO di WordPress per i principianti.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per i video tutorial 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

33 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

    I’m using PolyLang and now it seems like the PolyLang plugin itself has resolved it. Without any other plugin for hreflang, I have both languages in the source code, Czech and English.

  3. Daniele says

    Hello there,

    I have my main website in English but I want to create an Italian version of it. I just create a subdirectory of it named example.com/it and installed WordPress on it.

    Do I have to install the plugin described in the second method on my main website or the it one?

    thanks

    • WPBeginner Support says

      If you did that, you would want to use the second method. We would normally recommend using the first method for most users to be easier to maintain.

      Admin

  4. Miguel says

    In my specific case I need to implement “hreflang”, or is Not necessary since I’m using completely different domain names ? ?

    • WPBeginner Support says

      While in some cases it can be helpful, if you are using completely different domains then it is not required to use the hreflang tag.

      Admin

  5. shan ullah says

    its a real world help i thank full to you for this information i will definitely apply it on my website

  6. Nasir says

    Can we use hreflang code on a large site which has been targeting more than 80 regions? does it not increase the website load time?

  7. Dani says

    I already applied for a sitemap but I went through superb tutorail of your about herglang tag tell me now I have to again go for sitemap ? or it will automatically upload it

  8. Shyamu says

    I have been trying to add this hreflang tags in my site. But after adding the tags for a particular targetting country. Its still showing the “en-un” return error. How to solve this in Google Search Console?

  9. Mudassar says

    Hi, I am using English US in my WordPress and my content is also in English but even then Google Webmaster shows this message
    “Your site has no hreflang tags”

    My domain ends with .pk.

    Should i insert the following in header.php of my theme?

    If not, what i should do then?

    • Thomas Greenbank says

      If you are only writing for one language or region you can ignore the “no hreflang tags” message.
      That message will appear automatially, but just ignore it.

  10. didmin says

    I got question

    I am building a Germany website, after add my site into Google Search Console, it is showing me ” no hreftag” error

    My site is only targeting Germany speaking countries, and only in Germany language, so what should I do ?

    Please help me, very urgent!

    • Sam Jaff says

      Yes it will show ” No hreflang ” because you using online single language (Germany) on your website. If you want to target other countries then you have to make settings as mention up on this blog. So it will show in other language to target other country people. But as you said you just want to target German people then don’t consider hreflang and move forward.

  11. Pitshou Beya says

    If I have to use hreflang tags, do I have to translate manually each post? Or just implement the tag on the post

  12. Mitesh says

    Does the default lang=”en-us” have SEO factor that google will consider it to display more to USA visitors and less to other countries?

    Will changing to lang=”en” can benefit targeting

  13. Alice Miller says

    Hello,

    I am not using any specific lang tag for my website. As you told before that WordPress add html lang=”en-US” by default. I checked it’s there in my website. but whenever i am going through any tools there showing it’s missing. Please can you tell me what could be the error

  14. Thomas Greenbank says

    Thanks for posting this.
    If I have a post on a .com site that I want to target to en-au audience, do I need to have an en-us version also? What I mean is, can I have some posts on my site targeting US visitors and others targeting Aus visitors without duplicating them?
    Thanks in anticipation.
    Thomas.

  15. Khemraj says

    Hello,
    Suppose I have .com domain and i want to target it to countries like us, uk , canada, australia etc. If i created sub directory like example.com/us, example.com/in etc so to target specific countries do i need to install wordpress in each subdirectory ? ? ?

  16. Mitch says

    If you are only targeting one single language is there an SEO benefit for doing a Hreflang Tag or can it just be left unset?

  17. Rowels Brutte says

    Hello.
    An informative post on hreflang attribute.

    I am trying to implement it from a long time.
    But for example, if I want to have 3 different pages for the same language but different country like en-gb, en-us, en-au, how do I proceed?

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.