多语言网站的hreflang标签

在网页头部head中添加以下代码:

<link rel="alternate" hreflang="zh-CN" href="https://www168itw.com/seo/hreflang/" />

需要注意的是,不同语言的页面,一定要双向互相指向对方,否则hreflang不起作用,Google会忽略掉。

所以你需要在网页的header中列出所有的语言版本及链接。

还可以指定网页的默认语言版本:

<link rel="alternate" href="https://example.com/" hreflang="x-default" />

关于简体中文和繁体中文,也可以用zh-Hanszh-Hant

结合上文wordpress输出文章别名的方法,可以给wordpress站点设置多语言。

Google关于hreflang多语言的详细用法:

https://developers.google.com/search/docs/advanced/crawling/localized-versions

https://www.w3schools.com/tags/ref_language_codes.asp

本文链接: https://www.168itw.com/notes/hreflang/
转载请注明转载自:168itw

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注