网站首页 站群教程 站群优化教程 正文
很多泛目录程序都给模板添加了干扰码,以小旋风蜘蛛池为例,只要开了模板干扰,就会自动加一些无意义的div参数。
高端的seo一般都知道模板中的class添加随机字母,进行模板伪原创有利于seo优化和收录。
模板伪原创class添加随机字母作用是:让搜索引擎觉得网站的页面模板代码是独一无二的。
我们建站大多数是用各大cms的开源模板或者是cms里面的应用中心购买模板进行建站,这些模板都是成千上万人在用,对于seo优化各大搜索引擎收录和排名不大好(不是唯一不利于优化因素)。
不难发现市面高收录快速出权重的站,偶尔能看到他们的站点的模板里的class标签是有很多不一样的随机字母。
因为最近有小伙伴有这个需求,我就把代码放出来给大家参考。
模板干扰效果图
模板干扰代码
下面分享Zblog模板中可以调用的div class干扰码php的代码。
function template_class_code_v2($values, $format) { global $tp_code_index; if (is_null($tp_code_index)) { $tp_code_index = 0; } $classValue = ''; if (isset($values[$tp_code_index])) { $classValue .= $values[$tp_code_index]; } else { $tp_code_index = 0; $classValue .= $values[$tp_code_index]; } if ('unique' != $format) { $classValue .= '-'; } if (isset($values[$tp_code_index + 1])) { $classValue .= $values[$tp_code_index + 1]; } else { $tp_code_index = 0; $classValue .= $values[$tp_code_index]; } if ('unique' != $format) { $classValue .= '-'; } if (isset($values[$tp_code_index + 2])) { $classValue .= $values[$tp_code_index + 2]; } else { $tp_code_index = 0; $classValue .= $values[$tp_code_index]; } if ('unique' != $format) { $classValue .= '-'; } if (isset($values[$tp_code_index + 3])) { $classValue .= $values[$tp_code_index + 3]; } else { $tp_code_index = 0; $classValue .= $values[$tp_code_index]; } $tp_code_index++; return $classValue; } function template_replace($html) { # 此判断是是防止 zblogx 未初始化导致的 "字符串通过函数调用" $mode = 'static'; $format = "unique"; $mode = is_null($mode) ? 'static' : $mode; // 防止更新后默认为动态 $fullUrl = "http://".$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $string = md5($fullUrl) . sha1($fullUrl); $codeValues = template_text_chunk($string, 2); if ('static' != $mode) { shuffle($codeValues); // 非静态重新洗牌 } # 针对双引号 start-end preg_match_all('/class=\"(.*?)\"/i', $html, $result); $class = $result[0]; $html = preg_replace('/class=\".*?\"/', '{FLAG}', $html); foreach ($class as $item) { $item = str_replace('"', '', $item); // 保证 空的 class 能补全 $item = str_replace('=', '="', $item); $item = str_replace('class="', '', $item); $code = template_class_code_v2($codeValues, $format); $newClass = 'class="' . $code . ' ' . $item . '"'; $html = preg_replace('/\{FLAG\}/', $newClass, $html, 1); } # 针对单引号 start-end preg_match_all("/class=\'(.*?)\'/i", $html, $result); $class = $result[0]; $html = preg_replace("/class=\'.*?\'/", '{FLAG}', $html); foreach ($class as $item) { $item = str_replace("'", '', $item); $item = str_replace('=', "='", $item); $item = str_replace("class='", '', $item); $code = template_class_code_v2($codeValues, $format); $newClass = "class='" . $code . ' ' . $item . "'"; $html = preg_replace('/\{FLAG\}/', $newClass, $html, 1); } return $html; }
如果做正规战一般不建议大家添加这种代码,有时间研究这个,不如根据自己的需要修改一下自己的模板就可以了。
目录导航
模板干扰效果图
模板干扰代码
- 上一篇: 在宝塔面板通过伪静态屏蔽垃圾蜘蛛的方法
- 下一篇: 网站的关键词排名突然大幅度下降的解决办法
必看说明
- 本站中所有被研究的素材与信息全部来源于互联网,版权争议与本站无关。
- 本站文章或仅为文本内容原创,非程序原创。如有侵权、不妥之处,请联系站长第一时间删除。敬请谅解!
- 本站所有内容严格遵守国家法律的条例,所有研究的算法技术均来源于搜索引擎公开默认允许用户研究使用的接口。
- 阅读本文及获取资源前,请确保您已充分阅读并理解《访问曹操SEO网站需知:行为准则》。
- 本站分享的任何工具、程序仅供学习参考编写架构,仅可在本地的虚拟机内断网测试,严禁联网运行或上传搭建!
- 任何资源必须在下载后24个小时内,从电脑中彻底删除。不得传播或者用于其他任何用途!否则一切后果用户自负!
- 转载请注明 : 文章转载自 曹操SEO 给站群程序的模板添加上div模板干扰的php代码
- 本文标题:《给站群程序的模板添加上div模板干扰的php代码》
- 本文链接:https://www.ccooc.cn/104.html
猜你喜欢
- 2024-01-27 CCSEO原创蜘蛛统计v1.2
- 2023-10-22 CCSEO原创蜘蛛统计v1.1
- 2023-10-09 ccspider蜘蛛统计插件
- 2023-09-28 致力于100%纯开源站群程序的精品网站
- 2023-09-18 泛目录蜘蛛统计免费版
- 2023-09-17 搜狗分城市泛二级程序:基于懒人站群V2.4.1
- 2023-08-28 链接中“?scm=1102.xchannel:1475:110036.0.3.0~9010.400.0.5.0”的含义
- 2023-07-17 搜狗自动养站程序:基于懒人站群V2.4.1
- 2023-07-02 影视模板+自定义缓存:懒人站群V2.4.1
- 2023-06-27 粉色移动影视泛目录
你 发表评论:
欢迎- 3817℃遵纪守法:一起举报违法网址
- 946℃警惕“冒用身份”的电信网络诈骗
- 2990℃备案域名的买卖管控会越来越严,不要尝试!
- 1269℃6月1日是《中华人民共和国网络安全法》实施五周年
- 846℃违规事件分类与违规信息类型说明
- 774℃关于严格遵守网络安全法规的公告
- 2544℃百度正打击构造虚假标题等违规站点
- 1196℃「百日行动」“断卡”行动持续发力
- 3357℃影视模板+自定义缓存:懒人站群V2.4.1
- 3023℃粉色移动影视泛目录
- 2975℃搜狗自动养站程序:基于懒人站群V2.4.1
- 2396℃子域名模板+链接样式:懒人站群程序V2.3
- 2235℃下拉词采集+速度提升:懒人站群程序V2.4
- 1850℃支持双标题及自动采集:懒人站群程序V2.3
- 1799℃搜狗分城市泛二级程序:基于懒人站群V2.4.1
- 1527℃罪恶克星:多线程不良网站举报工具
- 01-27CCSEO原创蜘蛛统计v1.2
- 01-26通过伪静态实现非蜘蛛则跳转的代码
- 12-15如何提高小站被搜索引擎收录的机会?
- 12-15实现IP地址屏蔽和白名单功能的php代码
- 12-03百度搜索资源平台:热点问题追踪之消失的权益
- 12-03百度已噶:百度快速收录权限被回收
- 11-27如何使用伪静态全站301实现集权和保持流量到主站
- 11-18移动端多线程填表百度反馈工具V1.3
- 近期评论
- 文章归档
-
- 2023年12月 (2)
- 2023年11月 (2)
- 2023年10月 (7)
- 2023年9月 (24)
- 2023年8月 (6)
- 2023年7月 (20)
- 2023年6月 (13)
- 2023年5月 (26)
- 2023年4月 (48)
- 2023年3月 (27)
- 2023年2月 (15)
- 2023年1月 (11)
- 2022年12月 (16)
- 2022年11月 (7)
- 2022年10月 (33)
- 2022年9月 (45)
- 2022年8月 (18)
- 2022年7月 (23)
- 2022年6月 (24)
- 2022年5月 (10)
- 2022年4月 (54)
- 2022年3月 (68)
- 2022年2月 (3)
- 2022年1月 (4)
- 2021年12月 (27)
- 2021年11月 (20)
- 2021年10月 (4)
- 2021年9月 (22)
- 2021年8月 (71)
- 2021年7月 (4)
- 2021年6月 (17)
- 2021年5月 (28)
- 2021年4月 (1)
- 2021年3月 (39)
- 2021年1月 (8)
- 2020年12月 (31)
- 2020年11月 (15)
- 2020年10月 (50)
- 2020年9月 (114)
- 2020年8月 (63)
- 2020年7月 (30)
- 2020年6月 (50)
- 2020年5月 (127)
- 2020年4月 (83)
- 2020年3月 (92)
- 2020年2月 (82)
- 2020年1月 (18)
- 2019年12月 (79)
- 2019年11月 (16)
- 2019年10月 (35)
- 2019年9月 (3)
- 2017年12月 (1)
- 2017年11月 (203)
- 2017年10月 (155)
- 标签列表
- 站点信息
-
- 文章总数:2005
- 页面总数:7
- 分类总数:46
- 标签总数:336
- 评论总数:8692
- 浏览总数:5079362
本文暂时没有评论,来添加一个吧(●'◡'●)