How to add Google search console to hexo blog
Hening Wang

Add Google Search Console (GSC) to hexo blog

Install hexo-sitemap

1
npm install hexo-generator-sitemap --save

Add configuration to _config.yml

1
2
sitemap:
path: sitemap.xml

This will automatically generate a sitemap every time after deploying the website.

Verify the ownership of your site in GSC

  1. Go to GSC website
  2. Under URL prefix, enter your homepage URL.
    image
  3. Click Continue
  4. Use “Recommended verification methods”, i.e HTML file.
  5. Download the automatically generated .html file.
  6. Put this .html file into the source folder of your blog. (not _post, not anything, just root source folder)
  7. !IMPORTANT (This has been a big issue for me) Set layout as false in the frontal info of this .html file, otherwise you will get error with verification.
    1
    2
    3
    4
    5
    6
    7
    8
    # originally:
    google-site-verification: googlee6edfc5f795da21a.html

    # now change to:
    ---
    layout: false
    ---
    google-site-verification: googlee6edfc5f795da21a.html
  8. Alternative way for verification is to use HTML tag, see this post
  9. Add sitemap.xml to sitemap of GSC
  10. You are all set! After a while of waiting, tap site: your-blog-address into google search window to check if your blog has been properly tracked by GSC.
Powered by Hexo & Theme Keep
Unique Visitor Page View