私は最近、私のウェブサイトにドイツ語のサポートを追加しました。今は私のウェブサイトのドイツ語版を検索結果にドイツ語圏の訪問者に、そして英語版を他のすべての訪問者に表示したいと思います。hreflangタグで何が問題になっていますか?
デスクトップ
<link rel="canonical" href="https://example.com/">
<link rel="alternate" media="only screen and (max-width:651px)" href="https://m.example.com/">
<link rel="alternate" href="https://example.com/" hreflang="x-default">
<link rel="alternate" href="https://example.com/?hl=de" hreflang="de">
モバイル
<link rel="canonical" href="https://example.com/">
<link rel="alternate" href="https://m.example.com/" hreflang="x-default">
<link rel="alternate" href="https://m.example.com/?hl=de" hreflang="de">
そしてため、このhreflang
タグドイツバージョン(https://example.com/?hl=de
:私は私のデフォルトページ(https://example.com/
)へのリンクタグを追加しました):
デスクトップ
<link rel="canonical" href="https://example.com/">
<link rel="alternate" media="only screen and (max-width:651px)" href="https://m.example.com/?hl=de">
<link rel="alternate" href="https://example.com/" hreflang="x-default">
<link rel="alternate" href="https://example.com/?hl=de" hreflang="de">
モバイル
<link rel="canonical" href="https://example.com/">
<link rel="alternate" href="https://m.example.com/" hreflang="x-default">
<link rel="alternate" href="https://m.example.com/?hl=de" hreflang="de">
しかし、私は問題を抱えています。 GoogleでYoutubeを検索すると、YouTubeのドイツ語版(https://www.youtube.com/?gl=DE&hl=de
)のみが返されます。しかし私が私のウェブサイトを検索すると、Googleは自分のウェブサイトの英語版をデフォルトとドイツ語版をスニペットとして表示します。私のコードで何が間違っていますか?