UNIT-L
MAIN OUTPUT SECTOR
UNIT-R

Hexo SEO Optimization for Baidu and Google

Hexo SEO Optimization

First, install the sitemap generators:

1
2
npm install hexo-generator-sitemap --save
npm install hexo-generator-baidu-sitemap --save

Then add the following configuration to your _config.yml:

1
2
3
4
sitemap:
path: sitemap.xml
baidusitemap:
path: baidusitemap.xml

Restart Hexo, and you should see sitemap.xml and baidusitemap.xml generated in your public folder.

Sitemap Generation

Verification

Next, submit your site to Baidu and Google Search Console. You’ll need to verify ownership.

Google verification (URL prefix method recommended):
Google Verification

Baidu verification:
Baidu Verification

Both platforms usually provide an HTML meta tag or verification file. If using the meta tag, add it to your theme’s head.ejs file.

Head Code

Submitting Sitemaps

Baidu

Go to the Link Submission section and submit your sitemap URL. Also check the “Crawl Diagnosis” tool.
Baidu Sitemap
Baidu Diagnosis

HTTPS certification usually takes a couple of days.
HTTPS Passed

Google

Google Sitemap
Similar to Baidu, verify ownership and then submit your sitemap URL in the Search Console.