如何讓 GitHub Pages 被 Google 搜尋到
問題敘述
用 GitHub Pages架了網站,放了很久,他是不會主動加入 Google 的索引的,所以不會被搜尋到
為什麼 GitHub Pages 不容易被搜尋?
預設無 sitemap
沒有 meta 標籤
可能 robots.txt 被限制
那麼要如何讓你的靜態網頁出現在搜尋結果呢?
如何解決
建立 sitemap
建立 meta 標籤
- 至少要有
description
og:title
,og:image
,og:description
等 OG:Tag- 用 META 分享偵錯工具 確認分享的效果,若沒有更新可能是被快取住了,需要手動抓取最新
- 建立
robots.txt
範例:
txt
User-agent: *
Allow: /
Sitemap: https://yourdomain.github.io/sitemap.xml
以上都做完後,記得把你的網站登錄在 Google Search Console
Google Search Console 會需要驗證網站的所有權,驗證完成後就可以輸入網站內的網址,檢查這些網址有沒有被索引囉