Block Ad By Hosts

Internet上充满了垃圾广告,更有一些phishing广告。今天我发现有个细心的人整理了一份广告商所使用的域名清单,把它添加到hosts文件里,就不怕来自这些域名的广告在你屏幕上蹦出来了。只是:

  • Google Adsense 的广告也在打击范围之内,而我对Google的文字广告并不反感;
  • 我浏览的网站中,中文广告占很大比例,质量普遍不高,这份清单便宜了中文的广告商,对中文用户有欠照顾。

这个方法很简单,难得的是有心人在整理,大家就坐享其成了。因为全部是指向localhost,所以就算有心人判断失误,也不会有什么危害,更不会有DNS劫持发生。

# This Hosts file has been altered to block ad servers.
# To restore the file just
# delete everything below the first entry or rename hosts.nbk
# to hosts and move it to the proper directory.
# Updated: scroll down for date stamp
# This is an ad blocking hosts file compiled by
# Mike Skallas (user245 (at) hotmail.com)
# Available at http://everythingisnt.com/hosts.html
# Copyright 1999-2007. Please do not redistribute, use above link.
# Free only for Residential/Non-Profit use.
# Just add ‘127.0.0.1 ADSERVER’ to the bottom to continue the list.

因为列表很长,竟然超过WordPress Post字数限制,直接post需要修改”wp-includes/default-filters.php” file,

commenting

//add_filter(‘the_content’, ‘wpautop’);

这么做还不知道对WordPress有什么副作用。还是做一个单独的文件让大家下载吧,hosts.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *