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

Use noindex for URL with parameters?

· 52CE 我爱测

I have a homepage, https://example.com , where a parameter can be added to unlock a discount on our website https://example.com?code=abc . I don't want this URL to be appear in Google search results, which it currently does. Acco…

问题原文

原帖链接 · Tonald Drump · CC BY-SA 4.0

I have a homepage, https://example.com, where a parameter can be added to unlock a discount on our website https://example.com?code=abc. I don't want this URL to be appear in Google search results, which it currently does.

According to the following doc, I should add a noindex meta tag: https://support.google.com/webmasters/answer/9689846#make_permanent

I am wondering though if I really should add a noindex meta tag to my homepage when the code parameter is present. I obviously don't want to hurt my home pages' SEO. Specifically, I have some link juice for https://example.com?code=abc and would like that to benefit https://example.com.

Question 1: is this really safe?

Question 2: would a canonical tag serve the same purpose? So that https://example.com?code=abc declares https://example.com as canonical. To make things more complicated, the homepage is actually localized as https://example.com/de?code=abc and https://example.com/en?code=abc.

已采纳解答

原帖链接 · Maximillian Laumeister · CC BY-SA 4.0

You definitely want to use a canonical tag here, not noindex.

For URLs of the form https://example.com/de?code=abc, use a canonical tag pointing to https://example.com/de.

For URLs of the form https://example.com/en?code=abc, use a canonical tag pointing to https://example.com/en.

The noindex directive tells the crawler that it should not index the page. The canonical tag tells the crawler that it should index the page but at a different URL, which fits your intent much more closely.

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

资料来源与适用范围

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

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

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