"Your site has no hreflang tags" in Webmaster Tools

General questions regarding the use of languages in Joomla! 3.x.

Moderators: infograf768, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
garly01
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Wed May 08, 2013 12:38 am

"Your site has no hreflang tags" in Webmaster Tools

Post by garly01 » Thu Nov 08, 2018 6:01 pm

I attempted my first multi-region site.My first site is really just trial and error while I try to get to grips with it. So I followed all the instructions (or I think I did) and on the surface everything looks good to me. When I switch regions my urls are /index.php/en-us/ or index.php/en-au/ and so on but when I check the console in webmaster tools I get told "Your site has no hreflang tags" All my articles, categories and menus are set to their respective language tags. I have setup for the following regions US/CA/UK/NZ/AU just to test the water.

In the source code it looks to me like the hreflang tags are correct but I could be wrong

<link href="http://www.exercisewithcrohnsandcolitis ... php/en-nz/" rel="alternate" hreflang="en-NZ" />
<link href="http://www.exercisewithcrohnsandcolitis ... php/en-au/" rel="alternate" hreflang="en-AU" />
<link href="http://www.exercisewithcrohnsandcolitis ... php/en-ca/" rel="alternate" hreflang="en-CA" />
<link href="http://www.exercisewithcrohnsandcolitis ... php/en-us/" rel="alternate" hreflang="en-US" />
<link href="http://www.exercisewithcrohnsandcolitis ... ex.php/en/" rel="alternate" hreflang="en-GB" />

I want to start working on more sites but I want to filter out any mistakes I made before I start. Can anyone spot something obvious I have done wrong that would have google webmaster tell me there are no hreflang tags. The site is only up a week and was only crawled for the first time a few days ago would it take another couple of crawls before google indexes it correctly or is there something amiss on my end?

The site is http://www.exercisewithcrohnsandcolitis.com

Thank you
Last edited by toivo on Thu Nov 08, 2018 6:24 pm, edited 1 time in total.
Reason: mod note: moved from SEO for 3.x, retitled

User avatar
CyrusXxX
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 115
Joined: Wed Oct 04, 2017 6:23 am
Location: Belgrade Serbia
Contact:

Re: "Your site has no hreflang tags" in Webmaster Tools

Post by CyrusXxX » Fri Nov 09, 2018 1:03 am

Hello garly01, can you check if you have this line of code in your template index.php file:

Code: Select all

<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
Index.php is located in templates/your_template/index.php

If not add it like this:

Code: Select all

<!doctype html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
    <head>
    and so on....
Also I need to mention that you can manually change the Hreflang tag in the Language Pack of your site and in the Extensions > Language > Content Language if not done already.

Or for example you can use some plugins like this one for example:
https://extensions.joomla.org/extension/db8-hreflang/
Knowledge is power and power is knowledge.

https://regenesiscomputers.com

garly01
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Wed May 08, 2013 12:38 am

Re: "Your site has no hreflang tags" in Webmaster Tools

Post by garly01 » Fri Nov 09, 2018 1:42 am

Thanks for the reply
Yes I can confirm that my index.php file has the line <html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">

Is there any changes I need to make to my htaccess file I wonder. Looking through the source code I can't really pick out anything amiss with the hreflang tags

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18717
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: "Your site has no hreflang tags" in Webmaster Tools

Post by infograf768 » Fri Nov 09, 2018 5:50 am

This source code is perfect. Webmasters Tools is mistaking.
In Joomla the hreflang displays when one is on the Home page or when one displays an item with associations.
The code for this is in the language filter plugin.

NOTE: The https://extensions.joomla.org/extension/db8-hreflang/ JED plugin is useless as we have in core a system plugin called Language Code which lets one choose another lang tag for a specific language if desired.
For example, when using Arabic, as our default tag is ar-AA, our plugin can replace it in frontend source with any Arabic speaking country tag: ar-TN for Tunisia, etc.
The advantage of the core one is that it can change any or all of the content languages while that plugin can only do it for one language. Also, it already proposes a field for each existing Content Languages.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

garly01
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Wed May 08, 2013 12:38 am

Re: "Your site has no hreflang tags" in Webmaster Tools

Post by garly01 » Fri Nov 09, 2018 11:33 am

Thank you @infograf768
I posted the issue on the google webmaster forum. They said it can take a bit of time for the hreflang tool to process a new websites data so to check back in a week or two. So hopefully it will resolve itself. Thank you for the help.

N:B
Just as a side note and a little off my original topic. Joomla doesn't have a ie-en (ireland)language option. So could I use the db8 plugin to switch the ie-ga language pack to english?

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18717
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: "Your site has no hreflang tags" in Webmaster Tools

Post by infograf768 » Fri Nov 09, 2018 11:57 am

Just as a side note and a little off my original topic. Joomla doesn't have a ie-en (ireland)language option. So could I use the db8 plugin to switch the ie-ga language pack to english?
Forget db8. It is totally useless compared to the language code core plugin.

The language code Core plugin indeed lets change the source tag of "ga-IE" to "en-IE" (you mistake in your naming. There is no ie-ga pack. ga is the language _Gaelic_, and IE is the country code _Eire.), BUT the UI will be in Gaelic as its ini files would be used. It would be a mistake to do so.

You could evidently grace to the plugin, change en-GB to en-EI but in that case you would lose the en-GB content language.

To get an Irish English pack en-EI, one has to copy for example the en-GB pack and modify the tag everywhere in the files, make a package and install it.
This can be done in a few minutes with com_localise. Only a few things need to be edited after using its copy function.
As we have no en_ei.gif language flag in core, you would have to use in the content language the ga_ie.gif image.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Post Reply

Return to “Language - Joomla! 3.x”