🧱 一、濫用 Meta Robots 標簽
? 常見問題:
問題 | 描述 |
---|---|
設置了 noindex 不該屏蔽的頁面 | 比如產品頁、分類頁被意外 noindex,導致不被收錄 |
設置 nofollow 導致內鏈失效 | 所有鏈接都被 nofollow,影響爬蟲抓取路徑 |
在 <meta> 標簽和 HTTP header 中沖突 | 比如 meta 設為 index,但 HTTP header 設為 noindex |
? 改善建議:
-
核心頁面使用:
<meta name="robots" content="index, follow">
-
僅對 隱私頁、后臺頁、重復內容頁 使用
noindex, nofollow
-
使用 GSC 檢查“已排除的頁面”原因,確認是否因 noindex
🧱 二、濫用 Canonical 標簽(rel=canonical)
? 常見問題:
問題 | 描述 |
---|---|
所有頁面都指向主頁 | 導致所有頁面內容都不被索引(Google 以為是重復頁) |
指向錯誤的 URL(比如 HTTP 版本) | 會造成錯誤頁面收錄 |
動態參數頁未正確規范 | 如分頁、篩選頁 canonical 到非匹配內容頁 |
? 改善建議:
-
每個頁面都應規范到自己或等價的原始版本,如:
<link rel="canonical" href="https://example.com/product/123" />
-
使用絕對路徑,確保協議(https)和域名一致
-
不要全站統一寫
<link rel="canonical" href="https://example.com/">
🧱 三、濫用 hreflang 標簽(多語言/地區)
? 常見問題:
問題 | 描述 |
---|---|
hreflang 設置國家語言代碼不對 | 比如寫成 en 而非 en-us ,或漏了地區 |
自引用缺失 | 頁面未包含指向自己的 hreflang 標簽 |
hreflang 與 canonical 指向不同頁面 | 會讓 Google 不知道信哪一個 |
頁面語言不對應 | hreflang 指的是西班牙語,頁面內容卻是英語 |
? 改善建議:
-
每個頁面都應包含 自我引用 + 所有語言版本,如:
<link rel="alternate" hreflang="en-us" href="https://example.com/us/page" /> <link rel="alternate" hreflang="es-pe" href="https://example.com/pe/page" /> <link rel="alternate" hreflang="x-default" href="https://example.com/" />
-
hreflang 和 canonical 應該保持一致(指向自己或同內容的頁面)
-
用 Google 的 hreflang 檢查工具 檢查是否互相指向
🔍 快速排查方法
工具 | 用法 |
---|---|
Google Search Console | 查看抓取/索引狀態、noindex/canonical/hreflang 錯誤 |
Screaming Frog SEO Spider | 批量檢查 meta robots、canonical、hreflang 設置是否正確 |
Ahrefs / SEMrush | 查看重復頁面、索引異常頁面 |
Site:example.com 搜索 | 檢查哪些頁面已被 Google 收錄(可能被 canonical 指錯) |
? 總結:改進要點
標簽 | 正確用法 | 改善關鍵 |
---|---|---|
meta robots | 只屏蔽非核心頁面 | 核心頁面必須 index, follow |
rel=canonical | 每頁只指向等價唯一頁面 | 避免全站統一、避免參數誤指 |
hreflang | 含自引用、語言正確、頁面匹配 | 與 canonical 保持一致 |
元機器人
<meta name="robots" content="指令1, 指令2">
放在 <head>
中。
🧾 常見的 content 指令解釋:
指令 | 含義 |
---|---|
index | ? 允許搜索引擎收錄此頁面(默認) |
noindex | ? 不讓搜索引擎收錄此頁面(頁面不會出現在搜索結果中) |
follow | ? 允許搜索引擎繼續抓取頁面上的鏈接 |
nofollow | ? 不讓搜索引擎抓取頁面上的鏈接 |
noarchive | 不顯示緩存快照(Google 搜索結果的“緩存”) |
nosnippet | 不顯示摘要片段(meta 描述、結構化數據) |
max-snippet:0 | 限制摘要片段字數 |
max-image-preview:none | 禁止圖像預覽 |
? 示例:
1. 允許索引和跟蹤鏈接(默認,無需設置)
<meta name="robots" content="index, follow">
2. 不收錄,但允許抓取鏈接
<meta name="robots" content="noindex, follow">
👉 常用于:登陸頁、重復內容頁、支付成功頁等
3. 不收錄,也不跟蹤鏈接
<meta name="robots" content="noindex, nofollow">
👉 常用于:后臺、測試頁面、用戶隱私頁面
🚫 注意事項:
-
不寫 robots 標簽,默認就是
index, follow
。 -
一旦設置了
noindex
,頁面就不會被收錄,無論鏈接多好。 -
若 robots.txt 中屏蔽了頁面,meta robots 不會生效(因為根本訪問不到頁面)。
🔍 檢查工具:
-
瀏覽器 → 右鍵查看網頁源代碼 → 搜索
meta name="robots"
-
Google Search Console → URL 檢查工具 → 查看“頁面可索引性”