国强极客
有问题请加微信:guoqiang7585
国强极客

屏蔽SemrushBot等国外垃圾营销蜘蛛的两种方法

屏蔽SemrushBot等国外垃圾营销蜘蛛的两种方法

最近发现网站有大量的国外蜘蛛访问网站,SemrushBot,AhrefsBot这两个营销蜘蛛的访问,竟然占了蜘蛛总数的90%还多,这些国外的垃圾蜘蛛抓取了我们中文网页不光没什么用,反而大大的拖慢了网站的速度,下面就说两种方法来屏蔽这些国外的垃圾蜘蛛。

国外垃圾蜘蛛

方法一:robots.txt

大家都知道网站根目录都有一个robots.txt文件,记录了网站哪些页面搜索引擎可以访问,哪些禁止访问,大部分正规的搜索引擎都会遵守,我们可以先设置robots文件,毕竟这么操作最简单。

主要封禁的是:MJ12bot、SemrushBot、AhrefsBot。robots.txt文件如下,大家可以做个参考:

User-agent: MJ12bot
Disallow: /
User-agent: SemrushBot
Disallow: /
User-agent: SemrushBot-SA
Disallow: /
User-agent: SemrushBot-BA
Disallow: /
User-agent: SemrushBot-SI
Disallow: /
User-agent: SemrushBot-SWA
Disallow: /
User-agent: SemrushBot-CT
Disallow: /
User-agent: SemrushBot-BM
Disallow: /
User-agent: SemrushBot-SEOAB
Disallow: /
user-agent: AhrefsBot
Disallow: /
User-agent: DotBot
Disallow: /
User-agent: Uptimebot
Disallow: /
User-agent: MegaIndex.ru
Disallow: /
User-agent: ZoominfoBot
Disallow: /
User-agent: Mail.Ru
Disallow: /
User-agent: BLEXBot
Disallow: /
User-agent: ExtLinksBot
Disallow: /
User-agent: aiHitBot
Disallow: /
User-agent: Researchscan
Disallow: /
User-agent: DnyzBot
Disallow: /
User-agent: spbot
Disallow: /
User-agent: YandexBot
Disallow: /

方法二:修改网站配置文件

虽然设置了robots.txt,但是为什么叫垃圾蜘蛛,就是一些蜘蛛不遵守robots文件,所以如果遇到不遵守的,我们就需要直接在网站的配置文件里面修改了,以宝塔linux配置为例,添加如下代码:

#禁止垃圾蜘蛛抓取
if ($http_user_agent ~* (SemrushBot|python|Linespider|crawler|DingTalkBot|simplecrawler|ZoominfoBot|zoombot|Neevabot|coccocbot|Facebot|YandexBot|Adsbot|DotBot|Applebot|DataForSeoBot|MJ12bot|BLEXBot|trendictionbot0|trendictionbot|AhrefsBot|hubspot|opensiteexplorer|leiki|webmeup)) { return 444;
}

代码里面的这些蜘蛛基本上都是无用蜘蛛,就像我的蜘蛛里的占最头的SemrushBot就是营销蜘蛛,还有一些是对网站没啥用的蜘蛛如Facebot、Applebot等。

国内搜索引擎蜘蛛

再给大家分享一下国内主流搜索引擎的蜘蛛,大家设置的时候注意不要把这些屏蔽了。

头条:Bytespider头条蜘蛛
谷歌:Googlebot搜索引擎http://www.google.com/bot.html
神马:YisouSpider搜索引擎https://zhanzhang.sm.cn/open/spider
百度:Baiduspider搜索引擎http://www.baidu.com/search/spider.htm
头条:Bytespider 头条引擎
搜狗:sogou spider 搜索引擎 http://www.sogou.com/docs/help/webmasters.htm#07
必应:bingbot搜索引擎http://www.bing.com/webmaster/help/which-crawlers-does-bing-use-8c184ec0
360:360Spider搜索引擎http://www.haosou.com/help/help_3_2.html
soso:Sosospider搜索引擎http://help.soso.com/webspider.htm
雅虎:Yahoo!搜索引擎http://help.yahoo.com/help/us/ysearch/slurp
赞赏
对内容有疑问,请加我微信:guoqiang7585
# #
首页      运营安全      网站运营      屏蔽SemrushBot等国外垃圾营销蜘蛛的两种方法

国强极客

文章作者

博客站长,有问题请加微信【guoqiang7585】。

国强极客

屏蔽SemrushBot等国外垃圾营销蜘蛛的两种方法
最近发现网站有大量的国外蜘蛛访问网站,SemrushBot,AhrefsBot这两个营销蜘蛛的访问,竟然占了蜘蛛总数的90%还多,这些国外的垃圾蜘蛛抓取了我们中文网页不光没什么用,反而大大的拖慢了…
扫描二维码继续阅读
2022-11-22