# Multi Language localization re SEO for Greater China (3 types of Chinese)

**URL:** <https://forum.wixstudio.com/t/multi-language-localization-re-seo-for-greater-china-3-types-of-chinese/60684>\
**Category:** Ask the community\
**Tags:** code, seo, wix, question\
**Created:** [July 10, 2024, 9:33am UTC](https://forum.wixstudio.com/t/multi-language-localization-re-seo-for-greater-china-3-types-of-chinese/60684 "2024-07-10T09:33:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alchen00](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/alchen00/32/34230_2.png) [@alchen00](https://forum.wixstudio.com/u/alchen00)\
**Post date:** [July 10, 2024, 9:33am UTC](https://forum.wixstudio.com/t/multi-language-localization-re-seo-for-greater-china-3-types-of-chinese/60684/1 "2024-07-10T09:33:58Z")

</div>

**Question:**  
Using embedding custom code in Wix, is there a way I can alter the hreflang tags?

**Product:**  
Wix Editor

**What are you trying to achieve:**  
I created a multilingual website for English and Greater China (Hong Kong, Taiwan, China). In the Wix multilingual module, I can only select one Chinese, which I have selected for Hong Kong. I have added also Twi (TW) for Taiwan and Sardinian (SC) for China. From the user perspective the website is usable for Greater China, with 3 types of Chinese.

**From an SEO perspective, is my main question.**  
On webpage’s header, Wix auto generated hreflang as follow:

```javascript
<link rel="alternate" href="https://www.lazywealthy.com/" hreflang="x-default"/>
<link rel="alternate" href="https://www.lazywealthy.com/sc" hreflang="sc-it"/>
<link rel="alternate" href="https://www.lazywealthy.com/tw" hreflang="tw-gh"/>
<link rel="alternate" href="https://www.lazywealthy.com/zh" hreflang="zh-hk"/>
<link rel="alternate" href="https://www.lazywealthy.com/" hreflang="en-us"/>

```

Using custom code in Wix, is there a way I can alter the hreflang, so it becomes like this for Taiwan (zh-cn) and (zh-tw)?

```javascript
<link rel="alternate" href="https://www.lazywealthy.com/sc" hreflang="zh-cn"/>
<link rel="alternate" href="https://www.lazywealthy.com/tw" hreflang="zh-tw"/>

```

 ![Screenshot 2024-07-10 141449](https://us1.discourse-cdn.com/wix/original/3X/b/e/be7ddaaf0ea142c9358d2a402f9a97884258dcbf.jpeg)

Would be great if the search engines can read the website language correctly.

**What have you already tried:**  
Tried these resources to no avail. I need to override the Wix default hreflang?  
https://support.wix.com/en/article/header-code-meta-tag-guidelines  
https://support.wix.com/en/article/embedding-custom-code-on-your-site

---

<div class="post-metadata">

**Author:** ![alchen00](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/alchen00/32/34230_2.png) [@alchen00](https://forum.wixstudio.com/u/alchen00)\
**Post date:** [July 10, 2024, 12:10pm UTC](https://forum.wixstudio.com/t/multi-language-localization-re-seo-for-greater-china-3-types-of-chinese/60684/2 "2024-07-10T12:10:16Z")

</div>

Wix actually have a very simple solution to customize the hreflang, as follow:

1. Go to the Multilanguage module from “Manage Languages”.

![Screenshot 2024-07-10 200036](https://us1.discourse-cdn.com/wix/original/3X/7/d/7df5e7f70e0438f270b6f14485c496a272e3111f.png)

1. Click on the “… icon” and select “Set regional format” for the language you want to custom the hreflang tag.

 ![Screenshot 2024-07-10 200059](https://us1.discourse-cdn.com/wix/original/3X/3/0/305320f936d64fb2709db5382cc0b216ecb64a1b.png)

1. Select the Region locale you want (afterwards hit publish to be safe).

![Screenshot 2024-07-10 200116](https://us1.discourse-cdn.com/wix/original/3X/f/a/fa89743292047e8766c83835cb1f9662073466a2.png)

1. Check the hreflang tag on the web page to see if you get the desired result.

 ![Screenshot 2024-07-10 200135](https://us1.discourse-cdn.com/wix/original/3X/f/3/f315b95b8d502fd6617224171ed3d07431599c0a.png)

---

<div class="post-metadata">

**Author:** ![alchen00](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/alchen00/32/34230_2.png) [@alchen00](https://forum.wixstudio.com/u/alchen00)\
**Post date:** [October 2, 2024, 2:28am UTC](https://forum.wixstudio.com/t/multi-language-localization-re-seo-for-greater-china-3-types-of-chinese/60684/3 "2024-10-02T02:28:31Z")

</div>

If you also want to change the html tag to avoid “Mismatch Hreflang and Lang Attributes”, then add custom code to the header of the page as follow:

To change the `<html lang>` attribute in Wix using custom code, you can follow these steps:

**1. Access Custom Code Settings** :

- Go to your site’s dashboard.
- Navigate to **Settings**.
- Scroll down to the **Advanced** section and click on **Custom Code**.

 ![image](https://us1.discourse-cdn.com/wix/original/3X/b/3/b3f65b3b691390d157a3d67d4eb1b5304369edf5.png)

**2. Add Custom Code** :

- Click on **+ Add Custom Code** at the top right.
- Paste the following code snippet into the text box

```javascript
<script>
  if (document.documentElement.lang === 'sc' || document.documentElement.lang === 'tw') {
    document.documentElement.lang = 'zh';
    console.log('Language attribute changed to zh');
  }
</script>

```

**3. Configure Code Placement** :

- Enter a name for your code (e.g., “Change HTML Lang”).
- Select **All pages** or choose specific pages where you want this code to apply.
- Choose **Head** under the **Place Code in** section.
- Click **Apply**.

**4. Verify Implementation**

- Go to the console on the browser and check the elements for the html lang attribute is changed to your desired lang code

 ![image](https://us1.discourse-cdn.com/wix/original/3X/5/4/54634fa05f8bdc7aed362d4061cf109525f17c50.png)

---

<div class="post-metadata">

**Author:** ![alchen00](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/alchen00/32/34230_2.png) [@alchen00](https://forum.wixstudio.com/u/alchen00)\
**Post date:** [October 2, 2024, 6:59am UTC](https://forum.wixstudio.com/t/multi-language-localization-re-seo-for-greater-china-3-types-of-chinese/60684/4 "2024-10-02T06:59:32Z")

</div>

For more accurate locale, you can use the code below

```javascript
<script>
  if (document.documentElement.lang === 'en') {
    document.documentElement.lang = 'en-us';
  } else if (document.documentElement.lang === 'zh') {
    document.documentElement.lang = 'zh-hk';
  } else if (document.documentElement.lang === 'tw') {
    document.documentElement.lang = 'zh-tw';
  } else if (document.documentElement.lang === 'sc') {
    document.documentElement.lang = 'zh-cn';
  }
</script>

```
