让博客网站被百度和Bing收录的方法及注意事项
1。如何使您的博客网站包括1.1。首先检查您的网站是否已包含以百度为例
1.2。让百度包括您的网站
HTML标签验证
CNAME验证(建议)
对于Hexo的博客,我个人建议CNAME和文件验证是两个
网站验证成功后,您可以在网站上管理您的网站。
提交您的网站后,毫无意外的是,搜索引擎将在几周内包括您的网站。通常,它不超过一个月。如果超过一个月,可能会有问题。
1.3。让bing包括您的网站
为了保持经过验证的状态,即使在验证成功之后,也不要删除元标记。
CNAME验证(建议)
将cname记录添加到域名服务器
添加记录的名为XXX和值的CNAME(别名)。
选择一种类型的三种验证方法并进行了验证
1.4。优化结构
SEO搜索引擎优化认为,该网站的最佳结构是用户可以从主页到主页的任何页面,但是Hexo 编译的URL的URL是:/Year // Day/Day/Title的四层结构,因此URL结构不利于SEO,爬行动物通常无法攀登我们的文章。因此,我们可以将URL直接更改为/标题的形式。这
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="json">url: http://你的网站
root: /
permalink: :title.html
permalink_defaults:
pretty_urls:
trailing_index: false # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks
</code></pre></p>
建议在此处添加HTML后缀,以便搜索引擎还可以判断它是URL后缀中的HTML页面
建议false生成的目录结构将缩短一层以成为'http:// your//title.html'
如果未设置为false,则页面的永久连接为'http:// / //title/index.html'
1.5。添加站点地图
站点地图允许搜索引擎更方便地捕获您的网站,通常是XML文件。
Hexo有两个插头,可以自动生成:
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="bash">npm install hexo-generator-sitemap --save
npm install hexo-generator-baidu-sitemap --save
</code></pre></p>
安装完成后,输入Hexo根目录的.yml配置文件,添加以下代码:
1.6。自动生成
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="bash"># common sitemap for all the search engines
sitemap:
path: sitemap.xml
# for baidy
baidusitemap:
path: baidusitemap.xml
</code></pre></p>
https://img1.baidu.com/it/u=3234597312,1402493053&fm=253&fmt=JPEG&app=138&f=JPEG?w=706&h=500
每次Hexo G运行时,.xml.xml将在缓存文件夹下成功。
生成后,您需要将其提交给搜索引擎:
百度进入搜索资源平台的站点管理,单击,添加.xml路径
进入,输入网站图,添加.xml路径
其中,.xml文件是搜索引擎的通用文件
1.7。关键字和描述的优化
他正在告诉您网页的搜索引擎的关键字以及您在网页上所做的事情,您不能随机写入它。
1.8。代码压缩
网页的代码具有大量空白符号,压缩代码可以提高网站访问的速度。
安装上面的插头-in:
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="bash">
npm install hexo-neat --save
</code></pre></p>
配置插头-in
在根目录中修改配置文件.yml添加以下代码:
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="yaml">
neat_enable: true
neat_html:
enable: true
exclude:
neat_css:
enable: true
exclude:
- '**/*.min.css'
neat_js:
enable: true
mangle: true
output:
compress:
exclude:
- '**/*.min.js'
- '**/index.js'
</code></pre></p>
1.9。添加.txt
在优化网站期间,有时网站上有重要的私人内容。网站管理员不希望蜘蛛捕获一些页面,例如背景中的数据,测试阶段的网站以及非常普遍的情况。搜索搜索。搜索。发动机捕获的大量有意义的页面。
.txt是一个纯文本文件,用于声明网站中蜘蛛不希望访问的零件,或指定蜘蛛捕获的一部分。当蜘蛛访问网站时,它将首先检查该站点是否存在.txt,如果您找到它,请找到它。蜘蛛将根据文件中的内容确定捕获的范围。如果文件不存在,则蜘蛛将直接抓住链接。也就是说,只有在您需要禁止某些内容的情况下,这才有意义。
配置方法如下:
例如:
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="text"># welcome to : eagle's blog
User-agent: *
Allow: /
Allow: /archives/
Allow: /categories/
Allow: /about/
Disallow: /js/
Disallow: /css/
Disallow: /fonts/
Disallow: /vendors/
Disallow: /lib/
Sitemap: https://your_site_address/sitemap.xml
</code></pre></p>
请注意,线路顺序有意义
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="text">举例说明:
允许爬虫蜘蛛访问 /admin/ 目录下的seo文件夹
User-agent: *
Allow: /admin/seo/
Disallow: /admin/
如果Allow 和 Disallow 的顺序调换一下:
User-agent: *
Disallow: /admin/
Allow: /admin/seo/
爬虫蜘蛛就无法访问到 /admin/ 目录下的 seo 文件夹,因为第一个 Disallow: /admin/ 已匹配成功。
</code></pre></p>
监视和更新百度网站管理员平台
提示要检测您更新文件并成功。
2。开放百度推动
每次更新博客时,都会提交链接到Baidu,这有利于SEO。
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="bash">npm install hexo-baidu-url-submit --save
# 使用淘宝cnpm可以加快速度
cnpm install hexo-baidu-url-submit --save
</code></pre></p>
3。谷歌在内
首先,在这样做之前,友好的提示是大家好,最好打开VPN,因为许多涉及服务,我在这里使用,互联网上有很多,您可以找到它,您可以使用它,您可以使用它,也可以使用
打开,添加博客地址。并进行相关验证,可以根据提示完成认证,该认证成功如下:
身份验证方法实际上与百度相似。还有三种类型。我用来直接下载文件并将其放入我的网站目录中。并同步文件指令)
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="bash">hexo clean && hexo g && hexo d
</code></pre></p>
之后,我去了身份验证,发现它无法进行验证。后来,我去了网站配置。 Atyml添加了一个代码,类似于百度
<p style='margin-bottom:15px;color:#555555;font-size:15px;line-height:200%;text-indent:2em;'> <pre><code class="yaml">google-site-verification: true
</code></pre></p>
页:
[1]