05
2008
0

给wordpress 增加干扰码防采集

打开 -includes下的post-template.php
先将代码加到 post-template.php 第一行

function RndString($body)
{
  //最大间隔距离(如果在检测不到p标记的情况下,加入混淆字串的最大间隔距离)
  $maxpos = 1024;
  //font 的字体颜色
  $fontColor = “#FFFFFF”;
  //div span p 标记的随机样式
  $st1 = chr(mt_rand(ord(“A”),ord(“Z”))).chr(mt_rand(ord(“a”),ord(“z”))).chr(mt_rand(ord(“a”),ord(“z”))).mt_rand(100,999);
  $st2 = chr(mt_rand(ord(“A”),ord(“Z”))).chr(mt_rand(ord(“a”),ord(“z”))).chr(mt_rand(ord(“a”),ord(“z”))).mt_rand(100,999);
  $st3 = chr(mt_rand(ord(“A”),ord(“Z”))).chr(mt_rand(ord(“a”),ord(“z”))).chr(mt_rand(ord(“a”),ord(“z”))).mt_rand(100,999);
  $st4 = chr(mt_rand(ord(“A”),ord(“Z”))).chr(mt_rand(ord(“a”),ord(“z”))).chr(mt_rand(ord(“a”),ord(“z”))).mt_rand(100,999);
(查看全文…)

作者 卍追峰Pillar卐 发表于: SEO、技术相关研究及文章 | 标签:, , , , , , , ,
  • 鲜果阅读器订阅图标
  • 推荐搜索:

  • Powered by D.V.B. Theme: 追峰. Blog由D.V.B法律频道提供法律支持

    京ICP备09022625号