问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
