How to show your Hexo blog on Google search
Add a website property to Search Console
Go to Google Search Console.
Under URL prefix, enter your homepage URL.
Click CONTINUE.
Verify your site ownership
Under “Other verification methods”, select HTML tag.
Copy and paste the meta tag inside
<head>
section of your site’s homepage.In my case, I go to
blog/themes/cactus/layout/_partial/head.ejs
and paste it inside the<head>
section:head.ejs 1
2
3
4
5
6
7
8
9
10
11<head>
<!-- so meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
// other codes...
<meta name="google-site-verification" content="zLOg-wm0CWmnn7HIsEiEjiz2B_93RmWxLAudRxe2JHk" />
</head>Deploy your site to commit changes.
Click VERIFY.
Click GO TO PROPERTY.
Submit your sitemap to Google
A sitemap is a file that lists all of the pages of a website and how they’re related to each other.
Under the root directory of your
Hexo
project, downloadhexo-generator-sitemap
plugin.$ npm install hexo-generator-sitemap --save
Configure
_config.yml
under the root directory:Add property:
_config.yml 1
2sitemap:
path: sitemap.xmlUpdate url:
_config.yml 1
url: https://foystor.github.io/
Generate sitemap.
$ hexo clean
$ hexo gYou can see
sitemap.xml
file generated inside thepublic
folder under the root directory.Deploy your site to commit changes.
Add your sitemap.
Click SUBMIT and wait for Google crawling your site.
Crawling can take anywhere from a few days to a few weeks.
References
Make your Jekyll Github Pages appear on Google search result (2 steps)