Support » Fixing WordPress » BAN IPs from Viewing

  • how can i ban IPs from viewing posts? I have already figured out who’s viewing the site from SiteMeter (down to the last two digits of the IP which SiteMeter doesn’t record)… so once I get their full IP, is there a PHP script that will detect and block their IP?
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • how can i ban IPs from posting?
    u mean the post or comments!
    they cant post until u authorize them.
    for comments, u will have to look for blacklist thingy. just search on the forums!

    no, i want a script so that when u go to the site, it checks your IP before loading the posts so that they can’t even see the blog

    I can see this back-firing so easy.
    Exactly how do you want this? Like have [black/white] listed [ips/ip ranges]? It would be pretty simple to create a function in my-hacks.php, say good-ip(), that returns true or false, and in your index.php simply put a if(good-ip()) { around your foreach loop.

    ok thx for the tips… i used the .htaccess file to ban selected IPs and a PHP script to log IPs
    thx guys 🙂

    a PHP script to log IPs
    Can you tell me about the script, what it does and how you installed it rpeeck? Thanks.
    Kevin

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.