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.

Our next available supporter will start replying to tickets in about 1.71 hours from now. Thank you for your understanding.

Author Posts
June 16, 2019 at 3:42 am #4029575

kamalpreetS

Hi there,

If you visit hidden link (and view the source code) you’ll see the href lang tags are missing the quotations around the domain, language, and property which may affect how Google in rendering this.

Can we please advise ASAP? Why is this happening?

Also, why is my global language en when it should read as “x-default”.

I really need to know the right practices so we can implement on our website.

Baljot

June 16, 2019 at 7:30 am #4029909

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for contacting WPML support.

It should not work like this.
Ex: check this site: hidden link
The language lang tag has quotation mark.

Could you please disable the WPML and it's glue plugins temporarily and check this?
Do you see the quotation marks if you disable the WPML and it's glue plugins?

Let me know.

Regards,
Riffaz.

June 16, 2019 at 3:43 pm #4030937

kamalpreetS

Hi there,

Sorry but I don't think what you sent helps. I know that's how the quotation marks are supposed to be on the language tags...

Your WPML plugin is supposed to automatically add the quotation tags. Obviously if I disable WPML the quotation tags will not work on the language marks as they won't exist!

Please advise.

Baljot

June 17, 2019 at 8:03 am #4032985

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Sorry if I did not explain clearly.

Any HTML/web page should have the correct language tag. WPML does not create this.

This source code from google.com : hidden link
Google does not use WPML but if you check it' source code you can see the language code with quotation there.
So it does not come/depend on WPML.

I just asked you to simply disable the WPML and then check the source code of your site.
Have you checked that?
Do you see the language tag with quotation mark in your site if you disable the WPML?

Let me know.

Regards,

June 18, 2019 at 2:36 pm #4044461

kamalpreetS

Hi there,

Who creates the tag? We are using WordPress? Is there a plugin for the tags? I'm not sure you entirely understand...ofcourse WPML's plugin creates the language tags or else what would?

Baljot

June 18, 2019 at 2:43 pm #4044491

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Let me know your site login details to check this closely.
Next reply is private.

Regards,

June 27, 2019 at 4:52 am #4096599

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for the details but the password is incorrect: hidden link
Please update with the correct password.
The next reply is private.

Regards,

June 30, 2019 at 6:23 am #4113449

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for the updated details.

I checked your site and it has quotation marks in lang href tags.
Here : hidden link

Please check this in incognito mode.
Hopefully, this is ok now.

Let me know if you need anything else.

Regards,

July 1, 2019 at 4:31 pm #4121165

kamalpreetS

Hi Riffaz,

Can you please check the main site though: hidden link

You'll see that was in staging? What's the difference?

Baljot

July 2, 2019 at 11:22 am #4126331

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

I do not have the login details to your live site.
Could you please give me the live site details? The next reply is private.

Also, for testing purpose can I disable some plugins in your live site?

Regards,

July 3, 2019 at 2:19 pm #4137301

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Riffaz is sadly not available today but I am glad to take care of your request.

I have just revised the code of your frontpage and the html tag does inlcude the lang attribute "en". In regards to your default language on WPML named "Global" with the hreflang "en" this is correct.

<html lang="en" prefix="og: hidden link">...</html>

Regarding the W3C there is nothing wrong about this attribute.
hidden link

You can check your URL for HTML markup issues here:
hidden link

Could you please clarify the issue a little further?

Kind regards
Andreas

July 3, 2019 at 3:15 pm #4137837

kamalpreetS

Hi there,

Sorry how did you revise the code? Can you please advise?

When I checked the view source it still has the quotations missing:

<link
rel=alternate hreflang=en href=hidden link
rel=alternate hreflang=en-ca href=hidden link
rel=alternate hreflang=en-us href=hidden link;

July 3, 2019 at 5:07 pm #4138301

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

In order to revise the code I went to your website and enabled the browser´s debug console with Strg + Shift + C.

Your example refers to the <link> tag, which only has navigation purpose.

The mandatory for the whole html element is defined in the <html> tag, as explained earlier.

It is further, correct, that the hreflang attribute does not include "double quotes" when using inside of a <link> tag. You can see this in the exampled on this site:

hidden link

Did you experience any issues in regards to the Google search results?

Kind regards
Andrea

July 4, 2019 at 9:09 pm #4146365

kamalpreetS

I'm sorry but I'm really confused here. Are you saying that the language tags are working incorrectly on the live website? How can you fix this then? What is your solution to this because we are using WPML and the same plugin/themes as the staging site.

Is this an issue with cache?

July 4, 2019 at 11:46 pm #4146459

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I am sorry about the confusion.

I was trying to explain that your page does have the correct language attribute inside of each tag.

As you already mentioned the "hreflang" attrinute can have impact on your site rating. The <link> tag in your example uses the attribute "hreflang". The difference here is that the hreflang attibute does by default not include double quotes. It only needs to inlcude quotation marks in case of an attribute that includes a space character or special symbols.

Here some examples from the Word Wide Web Consortium:

<html lang="en">

<link rel=alternate href="/en/html" hreflang=en type=text/html title="English HTML">

Also this would be valid:

<html lang=en>

While this would cause an error:

<html lang=en gb>

While this would be valid:

<html lang=en-gb>

Then I made some further research on W3C and found that:

See here:
hidden link

Conclusion: In fact any html attribute can be used without quotes, unless it contains more than one string, means it involves a space charecter or other szmbols. In this case the attribute will need to be wrapped into quotation marks.

Please see my screenshot from the HTML validator and test yourself. In case of an invalid element you will receive an error.

Could you please provide me a link with resource about that missing quotation marks on html attributes are having an impact on SEO? I was sadly not able to find anything about it.
As far I understand it would only matter if those attributes do exists or not, and as long we handle valid html, which we do, there should be nothing to worry about.

Kind regards
Andreas