Mark Ku's Blog

前言

最近發現有些網站有做 SEO,但都沒正常運行,所以就順手寫了一篇筆記,記錄如何驗證 SEO 功能面有辦法被 Google 爬蟲所收納。

方法一、最即時的方式,就是模擬爬蟲訪問網站

到 Chrome 市集安裝 user-agent-switch 套件

參考 Google Doc,得知 Google搜尋引擎的爬蟲,是採用什麼 useragent 來收錄你的網站

目前的 Googlebot 使用者代理程式
行動版:
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)

電腦版:
Mozilla/5.0 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)

「或」

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +https://www.google.com/bot.html) Safari/537.36

透過 chrome 套件 user-agent-switch,模擬 google bot 的訪問你的網站

設定自訂User-Agent字串的介面
設定自訂User-Agent字串的介面

結果發現被 Cloud Flare 擋下來了

瀏覽器顯示Cloudflare封鎖pixabay網站的錯誤頁面
瀏覽器顯示Cloudflare封鎖pixabay網站的錯誤頁面

我參考了Cloud falre社群的討論,得知看起來是他的規則造成的

Workaround
As @cs-cf said, the best thing to do is to disable the rules individually so you don’t lose all the other Cloudflare Specials benefits.

Step-by-step
Click the Firewall tab
Click the Managed Rules sub-tab
Scroll to Cloudflare Managed Ruleset section
Click the Advanced link above the Help
Change from Description to ID in the modal
Search for 100035 and check carefully what to disable
Change the Mode of the chosen rules to Disable
Rules matching the search
100035 - Fake google bot, based on partial useragent match and ASN
100035B - Prevent fake bingbots from crawling
100035C - Fake google bot, based on exact useragent match and DNS lookup
100035D - Fake google bot, based on partial useragent match and DNS lookup
100035U - Prevent fake BaiduBots from crawling
100035Y - Prevent fake yandexbot from crawling
A seventh rule related to fake bots was deployed during the incident:

100035_BETA - Fake google bot, based on partial useragent match and ASN

但這解法,礙於免費版不能管理這個規則,猜測是 Pro 版的預設規則所造成

Cloudflare WAF 管理規則頁面顯示升級專業版
Cloudflare WAF 管理規則頁面顯示升級專業版

如果 SEO 正常,就會顯示正常的頁面

瀏覽器顯示Let's菓鳳梨果乾電商網站首頁
瀏覽器顯示Let's菓鳳梨果乾電商網站首頁

方法二、驗證頁面有沒有正確被 google 收錄,這不是立即就生效,需要時間等待 Google 收錄。

訪問該網站,從 html 中取得 head description ,並拿去 google 搜尋

瀏覽器開發者工具顯示 meta description 標籤
瀏覽器開發者工具顯示 meta description 標籤

確認是否有沒有被正確收錄

Google搜尋Powershell Mongodb備份還原筆記結果
Google搜尋Powershell Mongodb備份還原筆記結果

方法三、查看 Google Search Console 收錄狀態

Google Search Console已索引但未提交Sitemap頁面
Google Search Console已索引但未提交Sitemap頁面

補充

Chrome DevTools > More tools > Network conditions > 取消 Use browser default 預設有好幾種 ua 可以讓你選,其中就包含了 Google Bot。

作者

Mark Ku

擁有 10+ 年經驗的資深軟體工程師,現為 AI 應用 Builder,專注於大型平台架構與簡化複雜系統設計,從電商系統到訂閱與收費平台,結合 AI Agent、AI 整合與自動化開發,打造高效率且可持續演進的產品技術基礎。閱讀更多

覺得這篇有幫助?

作者做的免費工具、每日 Podcast 與電子報,都在這裡。

Mark Ku · 本文採用 CC BY 4.0 授權,轉載請註明作者並附上原文連結。

留言

訂閱電子報

訂閱後即時收到新文章通知,不錯過任何技術分享。

提交即表示同意接收電子報,隨時可

熱門文章

View all
Mark Ku
··603

Oracle Cloud 永久免費方案 Linux 主機及固定 IP :0 元打造雲端解決方案

Oracle Cloud 永久免費方案 Linux 主機及固定 IP :0 元打造雲端解決方案
Mark Ku
··440

告別 Postman 收費陷阱!開源 Git 原生 API 測試神器 Bruno 實戰指南

告別 Postman 收費陷阱!開源 Git 原生 API 測試神器 Bruno 實戰指南
Mark Ku
··323

一款免費開源類似於 Notion 類知識庫系統 — Outline Wiki 佈署與備份全攻略

一款免費開源類似於 Notion 類知識庫系統 — Outline Wiki 佈署與備份全攻略
Mark Ku
··239

打造高效 API 管理平台:從 0 開始部署 Kong Gateway - Part 1

打造高效 API 管理平台:從 0 開始部署 Kong Gateway - Part 1
Mark Ku
··222

在 Ubuntu 上設置 Samba 來共享資料夾,讓 Windows 11 用戶可以存取

在 Ubuntu 上設置 Samba 來共享資料夾,讓 Windows 11 用戶可以存取
Mark Ku
··199

訓練自己的 AI 語音:硬體門檻、開源模型比較與 LoRA 微調

訓練自己的 AI 語音:硬體門檻、開源模型比較與 LoRA 微調