Streaming live at 10am (PST)

Changing the "lang" attribute of the html tag

Hello,

I’m building a multilingual website with a App that refer to the “lang” attribute of the html tag before the “head”.

In project setting->custom code i can change the tag but i need to change it on specific page, can you explain me the trick to make that append please?

Thanks in advance.!

LanuageCode|690x263

2 Likes

Hi @SmartWeb

Try checking the bottom of your your custom code settings page:

4 Likes

Hello @PixelGeek You didn’t read my post and didn’t see me attached file… I know this option.

I want to change this setting on a single page of the project, do you know how i can do this?

For example:

  • Home page -> FR
  • Product page -> EN

Thanks in advance.

my apologies. I don’t think there is a way to change it per page. I’ll ask the team and see if there is a way.

1 Like

@PixelGeek Ok thank you.

Maybe via JS after the head or before the body section?

Hello, I’m also trying to do the same. We have one website with multiple languages…


Did you manage to do it ?

Haha… classic!!
Been overlooking this for ages… :nerd_face:
Cheers @PixelGeek

The way I’ve done it is simply by defining the lang attribute manually in each page with custom code instead of using the option in project settings.
This is how I did it and some SEO checkers seem to find it correctly:

@harryqover if you have different language versions of the same page, you should also use hreflang tags, as shown in my screenshot, to tell google those are actually different languages. This way google won’t penalize you for duplicate content.

3 Likes

Thanks @TomiLynch. Very helpful. I forgot about the hreflang and penalisation possibilities from Google. :slight_smile: