Skip to content

非個人 Notion 資料庫的頁面,被 Google 大量索引 #3272

Open
@Raymondhou0917

Description

@Raymondhou0917

描述bug
Google Search Console 顯示大量非我 Notion 資料庫的頁面被索引。這些頁面的 URL 格式為 Notion ID 格式(32位十六進制字符),例如 /123456789012345678901234567890ab。這些頁面實際上並不存在於我的 Notion 資料庫中,但卻被 Google 爬蟲發現並索引,導致 GSC 顯示超過 30,000 個索引頁面,其中大多數是無效的。

我的 Notion 資料庫內,大概只有 100 多則頁面(文章)。

Google Search Console 索引頁面數量異常

期望的正常結果
期望只有我 Notion 資料庫中的有效頁面被索引,非資料庫的 Notion ID 頁面應該返回 404 錯誤或重定向到首頁,並且不被 Google 索引。sitemap.xml 應該只包含有效的頁面 URL。

復現步骤

  1. 使用 NotionNext 創建網站並部署
  2. 等待 Google 爬蟲爬取網站(約 1-2 週)
  3. 查看 Google Search Console 的索引覆蓋報告
  4. 發現大量非資料庫的 Notion ID 格式的 URL 被索引

我目前正嘗試通過以下方法解決此問題,不知道有沒有效 😅:

  1. blog.config.js 中啟用 UUID_REDIRECT: true
  2. 修改 robots.txt 禁止爬取 Notion ID 格式的 URL
  3. middleware.ts 中添加檢查,阻止訪問非資料庫的 Notion ID
  4. 在 [next.config.js] 中添加重定向規則,將 Notion ID 格式的 URL 重定向到 404 頁面
  5. 優化 sitemap.xml 生成,確保只包含有效頁面

這些修改在新部署的網站上有效,但對於已經被 Google 索引的頁面,需要一段時間才能從索引中移除。建議 NotionNext 在默認配置中加強對非資料庫 Notion ID 頁面的處理,防止它們被索引。

環境

  • NotionNext版本: 4.8.1
  • 主題: hexo
  • 部署方案: Zeabur
  • 操作系統: macOS
  • 瀏覽器: Chrome & Arc

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions