0%

用hexo提交部落格的sitemap到Google Search Console

Google Search Console工具可以用來查看使用者搜尋什麼關鍵字而觸及到你

想提升搜尋引擎最佳化 SEO (Search Engine Optimization,SEO) ,
可以把網站的sitemap提交到Google Search Console ,就可以在後台了解:

  1. 網頁搜尋總點擊次數
  2. 使用者點擊錯誤的網址數量
  3. 使用者會搜尋什麼關鍵字而到你的網站
  4. 使用者是從哪些國家搜尋的
  5. 行動裝置可用性

…等等相關。

其中,還可以查看「連結」:查看外部連結,哪些最熱門,來你的部落格的人又是點擊了哪些外部連結。

產生 Sitemap.xml

在 Hexo 有一個 Plugin 叫做 hexo-generator-sitemap,可以幫助生產網站的 Sitemap.xml,就可以拿這份檔案去提交了唷!來看以下簡單三個步驟。

安裝 Install

  1. 在部落格資料夾使用終端機輸入

    1
    npm install hexo-generator-sitemap --save
  2. 設定 Config

打開你的部落格資料夾,打開根目錄的 _config.yml,在最後面貼上:

1
2
3
sitemap:
path: sitemap.xml
template: ./sitemap_template.xml # 這行非必填,除非你想設定自訂的樣板
  1. 重新編譯一次,發布新內容:

hexo g -d
檢查看看有沒有順利產生 Sitemap.xml?

https://doug0849.github.io/sitemap.xml => 我的
提交至 Google Search Console
打開 Google Search Console

進入「索引 > Sitemap」

「新增 Sitemap」:sitemap.xml

測試sitemap.xml可不可以讀取

  1. 可以點選sitemap.xml進去後右上角有個開啟sitemap測試
  2. 使用左邊的網址審查 輸入完整位置 https://doug0849.github.io/sitemap.xml ,之後點選右上方測試線上網址

若都沒問題,就是Google問題,通常只能等了,也許需要等待好幾天甚至是一週的時間sitemap狀態才會轉為正常。

Welcome to my other publishing channels