微信小程序推出了sitemap,收录小程序内容用于搜索等多个场景

微信小程序推出了sitemap,收录小程序内容用于搜索等多个场景,第1张

微信小程序在 2019/03/29 号推出了 sitemap 功能。将会默认收录所有小程序的页面内容,用于微信搜索场景,这意味者开发者的小程序的曝光将会变多了。目前搜索小程序是燃备根据小程序的名称和简介来搜索,以后可以根据内容来出结果,这就更像网页了。 

小程序根目录下的 sitemap.json 文件用来配置小程序及其页面是否允许被微信索引

完整配置项说明请参考 小做段皮程序 sitemap 配置

例1:

所有页面都会被微信索引,其他页面不会被索引

例2:

包含 a 和 b 参数的 path/to/page 页面都会被微信索引,其他页面不会被索引,例如纯差:

path/to/page =>不被索引

path/to/page?a=1 =>不被索引

path/to/page?a=1&b=2 =>被索引

path/to/page?a=1&b=2&c=3 =>被索引

当你模毕在微信中搜索小程序后,还是没有发现自己的小程序。很有可能是在小程序商城中小程序的关键词排名因素导致的。那么如何让自己的小程序关键词排名靠前呢小编就和大家介绍一下小程序关键词的排名规则:

小程序上线时间越早,排名就会越靠前。微信小程序用户使用的数量越多,排名旦物芹就会越靠前完全匹配出现关键词次数越多,排名就会越靠前小程序的蚂李名称作为核心关键词语,排名就会越靠前小程序中的关键词出现1次,并且整体标题的字数越短的话,排名就会越靠前。

Robots.txt - 禁止爬虫

robots.txt用于禁止网络爬虫访问网站指定目录。robots.txt的格式采用面向行的语法:空雀老森行、注释行(以#打头)、规则行。规则行的格式为:Field: value。常见的规则行:User-Agent、Disallow、Allow行。

User-Agent行

User-Agent: robot-name

User-Agent: *

Disallow和Allow行

Disallow: /path

Disallow:           # 空字符串,起通配符效果,全禁止

Allow: /path

Allow:              # 空字符串,起通配符效果,全允许

搜索引擎的User-Agent对应名称

搜索引擎

User-Agent值

Google googlebot 

百度 baiduspider 

雅虎 slurp 

MSN msnbot 

Alexa is_archiver

我在Linux上抓包观察到的一些搜索引擎访问记录:

# tcpdump -n -nn -A -l -s1024 'tcp port 80'|grep User-Agent

User-Agent: Mozilla/5.0 (compatible Googlebot/2.1 +http://www.google.com/bot.html)

User-Agent: Googlebot-Image/1.0

User-Agent: Feedfetcher-Google (+http://www.google.com/feedfetcher.html 5 subscribers feed-id=4619555564728728616)

User-Agent: Mozilla/5.0(compatible Sosospider/2.0 +http://help.soso.com/webspider.htm)

User-Agent: Mozilla/5.0 (compatible YoudaoBot/1.0 http://www.youdao.com/help/webmaster/spider/ )

User-Agent: Mozilla/5.0 (compatible JikeSpider +http://shoulu.jike.com/spider.html)

JikeSpider是即刻搜索(人民搜索)。

robots.txt的补充

如果你没有对网站根目录的写入权限(无法建立robots.txt文件),或你想要某个指定的含郑网页不被搜索引擎收录,可以使用元标签阻止爬虫访问:

<meta name="robots" content="noindex">              <!-- 阻止所有爬虫 -->

<meta name="googlerobot" content="noindex">         <!-- 阻止Google收录 -->

robots元标记的默认值为"index,follow",它的取值可以是(来自Google站长帮助):

noindex防止网页被编入索引。nofollow防止googlebot从此页面中跟踪链接。noarchive防止Google显示网页的快照链接。noimageindex不被Google图片搜索索引。

现实中的robots.txt

淘宝屏蔽百度

淘宝屏蔽了百度抓取(2008年9月),http://www.taobao.com/robots.txt的内容:

User-agent: Baiduspider

Disallow: /

User-agent: baiduspider

Disallow: /

百度与360的搜索引擎之争

2012年8月,360推出搜索引擎,并与百度发生正面冲突。百度工程师跑出来说360违反robots协议,偷窃百度内容。以百度知道为例,顷亩http://zhidao.baidu.com/robots.txt的内容大致是这样:

User-agent: Baiduspider

Disallow: /w?

Allow: /

User-agent: Googlebot

User-agent: MSNBot

User-agent: Baiduspider-image

User-agent: YoudaoBot

User-agent: Sogou web spider

User-agent: Sogou inst spider

User-agent: Sogou spider2

User-agent: Sogou blog

User-agent: Sogou News Spider

User-agent: Sogou Orion spider

User-agent: JikeSpider

User-agent: Sosospider

Allow: /

User-agent: *

Disallow: /

也就是说对360爬虫而言,应该走最后一条规则,也就是禁止抓取百度知道所有内容。但从360搜索看,有百度知道的内容。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12498528.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存