The MU forums have moved to

Limit blog-reading access to IP-adresses possible? (3 posts)

  1. tobbe_l
    Posted 14 years ago #


    Got a Mu-installation running ok on 2.6.5. Thing is that I would like to limit access to one of my blogs to a series of certain IP-adresses. That is our to allow internal IP:s access to read the blog but not our external users.

    Is that possible and how?

    Thanks for any input on this.

  2. tmoorewp
    Posted 14 years ago #

    Firstly, you should upgrade to 2.8.4 for security as soon as you can.

    Secondly, you can do that through firewall rules on your server. Only allow connections on port 80 from the IP ranges that you want. Better to do it at the server level than the WordPress level.

    On second thought, that would cut off access too all of your blogs from external users. In WordPress, you can set a blog as "private", then give you internal users accounts on WordPress. They would then need to log in to view the private blog.

  3. dsader
    Posted 14 years ago #

    May be a place to start.

    Check the programming notes in comments at the top of the file for an example how to restrict access to all blogs to an ip

    if (     (strncmp('155.47.', $_SERVER['REMOTE_ADDR'], 7 ) == 0)  || (is_user_logged_in())                  ) {
            // user is either logged in or at campus
    else {

    Adding code to make it a user configurable option to specify the ip on a blog by blog basis I figure could be done. Good luck.

About this Topic