WordPress防采集

今天来给大家说说,WordPress网站如何防止采集软件采集,不过想完完全全防止是防不住的,不过简单阻止一下还是可以的,在主题目录中,找到“functions.php”,下载到本地,利用编辑器打开,切勿使用文本编辑器打开,插件以下代码,保存上传即可。后面如果发现其他更好的方法,也会放出。

//禁用 feed
function disable_our_feeds() {
wp_die( __('Error: No RSS Feed Available, Please visit our homepage.'));
}
add_action('do_feed', 'disable_our_feeds', 1);
add_action('do_feed_rdf', 'disable_our_feeds', 1);
add_action('do_feed_rss', 'disable_our_feeds', 1);
add_action('do_feed_rss2', 'disable_our_feeds', 1);
add_action('do_feed_atom', 'disable_our_feeds', 1);


// 防采集www.qicaiyun.top
if(!$_SERVER['HTTP_USER_AGENT']) { //判断是否为空AGENT
header("Content-type: text/html; charset=utf-8");
echo '禁止使用采集软件采集';
exit;
}


七彩云博客 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:WordPress防采集

您必须 登录 才能发表评论!

(8)个小伙伴在吐槽
  1. Teenage Drug Rehab Centers Near Me http://aaa-rehab.com Drug Rehab Centers Cornerstone Drug Rehab http://flighthubcap2.jigsy.com/entries/general/Tips-And-Tricks-For-Dealing-With-drug-rehab
    Residential Rehabilitation Treatment Programs2020-04-01 18:01 Windows 10 | Chrome 67.0.3396.99
  2. Center For Alcohol And Drug Treatment http://aaa-rehab.com Drug Rehab Near Me Free Inpatient Rehab http://www.sherifstores.com/blog/%D8%A8%D8%A8?page=90#comment-92096
    Substance Abuse Prevention Institute2020-04-01 02:07 Windows 10 | Chrome 67.0.3396.62
  3. Methadone Treatment Center http://aaa-rehab.com Drug Rehab Centers Near Me Residential Drug Treatment Programs http://school2ost.ru/user/rehabcenter/
    Meth Rehab2020-03-31 10:07 Windows 7 | Chrome 67.0.3396.99
  4. Methadone Treatment Center http://aaa-rehab.com Drug Rehab Centers Near Me Residential Drug Treatment Programs http://school2ost.ru/user/rehabcenter/
    Meth Rehab2020-03-31 10:05 Windows 7 | Chrome 67.0.3396.99
  5. Methadone Treatment Center http://aaa-rehab.com Drug Rehab Centers Near Me Residential Drug Treatment Programs http://school2ost.ru/user/rehabcenter/
    Meth Rehab2020-03-31 10:05 Windows 7 | Chrome 67.0.3396.99
  6. Meth Treatment Centers Near Me http://aaa-rehab.com Drug Rehab Residential Drug Treatment Programs Near Me http://vidoka.ru/user/rehabcenter/
    Residential Rehab Near Me2020-03-30 17:53 Windows 7 | Chrome 68.0.3440.106
  7. Meth Treatment Centers Near Me http://aaa-rehab.com Drug Rehab Residential Drug Treatment Programs Near Me http://vidoka.ru/user/rehabcenter/
    Residential Rehab Near Me2020-03-30 17:52 Windows 7 | Chrome 68.0.3440.106
  8. Outpatient Drug Rehab http://aaa-rehab.com Drug Rehab Centers Near Me http://aaa-rehab.com Drug Treatment Rehab http://aaa-rehab.com
    Free Methadone Clinic2020-03-27 11:56 Windows 10 | Chrome 66.0.3359.170