大网数据广告活动
网站运营与故障问答

Should en and x-default be included on the same page for hreflang tags?

· 52CE 我爱测

We are using a tool called SEMRush where it is flagging that the en and x-default values for the hreflang are causing conflicts. Should both en and x-default be included for the hreflang tags? This is what we have now. <html> <he…

问题原文

原帖链接 · usernameabc · CC BY-SA 4.0

We are using a tool called SEMRush where it is flagging that the en and x-default values for the hreflang are causing conflicts.

Should both en and x-default be included for the hreflang tags?

This is what we have now.

<html>
<head>
  <link rel="alternate" hreflang="de" href="https://de.example.com/">
<link rel="alternate" hreflang="en" href="https://www.example.com/">
<link rel="alternate" hreflang="x-default" href="https://www.example.com/">
<link rel="alternate" hreflang="es" href="https://es.example.com/">
</head>
<body>
 ....
</body>
</html>

已采纳解答

原帖链接 · Henry Visotski · CC BY-SA 4.0

Your implementation is correct. The tool you're using is either hinting that you may want to double check your setup, or it is plain incorrect in calling this out.

If you go through the Yoast Hreflang Guide, you'll note the "hreflang x-default" section, closer to the bottom. Here's the relevant part:

In this case, the x-default link would point to the same URL as the de one. We wouldn’t advise you to remove the de link though, even though technically that would create exactly the same result. In the long run, it’s usually better to have both as it specifies the language of the de page – and it makes the code easier to read.

Replace "de" with "en" and you basically have your example. Thus, I wouldn't worry about it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-12-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。