英文:
NextJS website index page. How to approach rel=canonical?
问题
I have this website https://www.buscamusicos.net. Google has "/index" page indexed, and I accidentally added /index to the sitemap.xml, so now Google Search Console is telling me that /index is a duplicate of /, and that I haven't set a canonical URL.
For now I've removed /index from the sitemap.xml, but I'm dubious about how to actually proceed. Should I add it again and add this to my index.js file?
<Head>
<link
rel="canonical"
href="https://www.buscamusicos.net/index"
key="canonical"
/>
</Head>
Or should I just forget about it?
Another issue is that currently the index page title is shown as BuscaMúsicos: Inicio, instead of what I set (Inicio - BuscaMúsicos). I wonder if adding the above code would make Google show the title I want.
英文:
I have this website https://www.buscamusicos.net. Google has "/" page indexed, and I accidentally added /index to the sitemap.xml, so now Google Search Console is telling me that /index is a duplicate of /, and that I haven't set a canonical URL.
For now I've removed /index from the sitemap.xml, but I'm dubious about how to actually proceed. Should I add it again and add this to my index.js file?
<Head>
<link
rel="canonical"
href="https://www.buscamusicos.net/index"
key="canonical"
/>
</Head>
Or should I just forget about it?
Another issue is that currently the index page title is shown as BuscaMúsicos: Inicio, instead of what I set (Inicio - BuscaMúsicos). I wonder if adding the above code would make Google show the title I want.
答案1
得分: 0
如果您已经从您的sitemap.xml中移除了/index,并且它在您的网站上没有其他链接,那么不需要担心,因为Googlebot将无法爬取它,它最终会从搜索结果中消失。
我建议您继续使用根目录(/)。您应该设置一个规范的URL,以指示搜索引擎/index页面的内容是根目录的重复内容。在这种情况下,代码应该如下所示:
<Head>
<link rel="canonical" href="https://www.buscamusicos.net/" />
</Head>
另一个问题是,目前index页面的标题显示为BuscaMúsicos: Inicio,而不是我设置的Inicio - BuscaMúsicos。我想知道添加上述代码是否会使Google显示我想要的标题。
确保您的标题如下所示,并且一旦Google重新爬取和重新索引您的页面,它应该反映在搜索结果中。
<Head>
<title>Inicio - BuscaMúsicos</title>
</Head>
英文:
If you have removed /index from your sitemap.xml and it is not linked anywhere else on your website, then there is no need to worry about it as Googlebot will not be able to crawl it and it will eventually drop out of the search results.
I would recommend you stick with the root directory (/). You should set up a canonical URL to indicate to search engines that the content on the /index page is duplicate content of the root directory. In this case the code should look like this:
<Head>
<link rel="canonical" href="https://www.buscamusicos.net/" />
</Head>
> Another issue is that currently the index page title is shown as BuscaMúsicos: Inicio, instead of what I set (Inicio - BuscaMúsicos). I wonder if adding the above code would make Google show the title I want.
Make sure your title looks like this and should be reflected in the search results once Google recrawls and reindexes your page.
<Head>
<title>Inicio - BuscaMúsicos</title>
</Head>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论