Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: Do i need to add any HREFLANG tag to our pages?

Solution: WPML handles that automatically, however if you want to edit yours, you can do so through WPML > Languages > Edit Languages

Relevant Documentation: https://wpml.org/documentation/support/adding-hreflang-wordpress/

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 24 replies, has 2 voices.

Last updated by allenc-4 1 year, 11 months ago.

Assigned support staff: Alejandro.

Author Posts
January 22, 2019 at 1:57 pm #3116787

allenc-4

Tell us what you are trying to do?

hidden link

is this ok?

<link rel="alternate" href="hidden link" hreflang="en-id" />
<link rel="alternate" href="hidden link" hreflang="id-id" />

January 22, 2019 at 3:10 pm #3117166

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hello!
Welcome to WPML Support.
I'll do my best to help you solve this issue.

Could you tell me what you want to achieve and where are you seeing that code?

January 22, 2019 at 7:47 pm #3118058

allenc-4

i just understand that we need these tags with multilanguage

this is restaurant in indonesia

we have two languages, english and indonesian

we want local people who search in indonesian language to see indonesian version

other people, both in indonesia and globally, to see english version

January 22, 2019 at 7:55 pm #3118073

allenc-4

are these tags only shown on home page?

do we need to create similar for other pages? and only show those tags on those pages?

very confusing!!

January 23, 2019 at 6:49 am #3119082

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hello,
You don't need to create anything else, WPML does this for you on each translated page on your site.

Each language will have its hreflang tag but you don't need this on each part of your site, in fact it will show at the beginning of your site to make sure every crawler gets this information as soon as possible.

I did notice you want to use the en_ID locale and right now your using en_US instead. This is not a big deal but it all depends on what you want to achieve.

To do this you would need to create a new language from WPML > Languages > Edit Languages
(since you cannot change the language code once it is set, as shown in the warning in the languages window)

Then duplicate your content to that new language, set it to default and delete the old en_US language.

It is highly recommended to use a full site and db backup before doing this to be cautious.

Let me know how it goes and don't hesitate to ask if you have questions about this process.

January 23, 2019 at 7:24 am #3119124

allenc-4

Hi,

to be clear..

we do not need to enter hreflang tags as you do all this? On all pages?

please reconfirm that we should remove all tags entered by us

eg on home page we have..

<link rel="alternate" href="hidden link" hreflang="en-en" />
<link rel="alternate" href="hidden link" hreflang="en-id" />
<link rel="alternate" href="hidden link" hreflang="en-au" />
<link rel="alternate" href="hidden link" hreflang="en-sg" />
<link rel="alternate" href="hidden link" hreflang="id-id" />
<link rel="alternate" href="hidden link" hreflang="x-default" />

January 23, 2019 at 7:58 am #3119166

allenc-4

you..."I did notice you want to use the en_ID locale and right now your using en_US instead. This is not a big deal but it all depends on what you want to achieve."

as aleady explained, this is restaurant in bali , indonesia. main website is english to be shown to all language speakers except indo. Indo speakers see indo site.

Please explain more clearly what you say about creating another language. Please be clear,

Thanks

January 23, 2019 at 8:09 am #3119240

allenc-4

is this correct? do we need it? hidden link

what next if we save it? please be clear

thanks

January 23, 2019 at 8:46 am #3119385

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

I'm sorry if i wasn't clear enough.

You said "main website is english to be shown to all language speakers except indo. Indo speakers see indo site."

I wasn't talking about this, because this is the expected behaviour either way. i was talking about the "technical" part. You see English is recognized as the same language no matter what "dialect" you choose (US English, India English, Indonesian English, Latin America English, etc).

What i meant is that if you want to tell Google that this site is written in "Indonesian English" (en_ID) then you should change the current locale code.

I now understand better what you want to achieve so follow these steps:

1) You can remove all tags entered by you
2) Go to WPML > Languages > Site Languages
3) Click on "Edit Languages"
4) Under "Defaul Locale" find the English Language and change "en_US" to "en_ID"
5) Click "Save Button"

That will tell Google that this site is in Both English (Indonesian version/dialect) and in Indonesian. this will be added to all the pages on your site. you don't have to add anything else manually.

I hope i was clearer this time, but if there is still something not clear enough, let me know.

January 23, 2019 at 8:56 am #3119458

allenc-4

FANTASTIC, THANKS

to confirm....outside of indonesia, eg australia , then the english[id] site will be used by google ?

January 23, 2019 at 9:01 am #3119469

allenc-4

your advice has been followed

please see hidden link and advise if incorrect

please review home page source to confirm all good

thanks for superb guidance

January 23, 2019 at 9:46 am #3119715

allenc-4

please see hidden link - any problem?

January 23, 2019 at 10:08 am #3119853

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hello,

You say:"to confirm....outside of indonesia, eg australia , then the english[id] site will be used by google ?"

-Answer.
Yes, the English content will be shown to English Speakers searching in English.

You say:
"please see hidden link and advise if incorrect"

-Answer: Yes, that's correct.

You say:
"please see hidden link - any problem?"

-Answer: Since WordPress doesn't have info for that Locale, it won't download files for that. That usually isn't a problem since WPML will still recognize the language is in English and will assign that Language to the translations. If you will need WordPress translations then revert to one of the above mentioned English "dialects". I repeat, this will not affect your site other than it won't be able to download some WordPress specific files.

Please let me know how it goes and if i was clear enough.

January 23, 2019 at 11:19 pm #3122696

allenc-4

please carefully reconfirm hidden link , particularly final column

we have now also injected restaurant schema structured data into indonesian home page - do you recommend this?

thanks

January 24, 2019 at 5:46 pm #3126329

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hello, i might know what's going on or at least what's part of it.

Turns out that the en-id hreflang is being triggered as a self referencing tag, which is not an error per se but that means that Google and other tools are not recognizing it as English (i ran several tests on different tools before i wrote here. that's partly why i'm only answering now and didn't answer sooner).

Please change "en-id" to "en-us" (which we know is broadly recognized) and try again, please.

P.S: I attached a reference screenshot of one of the analysis i ran just so you can see that even though it's recognized as English from Indonesia, it's not really working that great with it. That's why i'm suggesting you change it back to US English which is recognized everywhere.