Restricted Site Access

Restrict access to registered users and specific IP addresses. Control restriction behavior.

Limit access your site to visitors who are logged in or accessing the site from a set of specified IP addresses. Send restricted visitors to the log in page, redirect them, or display a message or page. A great solution for Extranets, publicly hosted Intranets, or parallel development / staging sites.

Adds a number of new configuration options to the Reading settings panel as well as the Network Settings panel in multisite. From these panels you can:

  • Enable or disable site restriction
  • Change the restriction behavior: send to login, redirect, display a message, display a page
  • Add IP addresses to an unrestricted list, including ranges
  • Quickly add your current IP to the unrestricted list
  • Customize the redirect location, including an option to send them to the same requested path and set the HTTP status code for SEO friendliness
  • Define a simple message to show restricted visitors, or select a page to show them – great for “coming soon” teasers!

Screenshot of settings panel with simple Restricted Site Access option (send to login page).

Screenshot of settings panel with restriction message option enabled

Plenty of inline help! Looks and behaves like native WordPress help.

  • Rating
  • Requires 5.7+
  • Downloads 806,438
  • Updated 2023-12-14
  1. What’s the best channel for reporting an apparent bug? On WP 3.7.1 (and maybe older versions, dunno) this plugin doesn’t honor the status code, and instead sometimes uses 500. This is obviously not-ideal. I’ve got a partial fix, but I’m not intimately familiar with the code and it may need refinement.

  2. Hi,
    I’m facing a problem since even with a restricted website, users who know a media file URL (eg. word, pdf…) can still have direct URL access to it. Is there a way to completely restrict the access? (eg. A old employee of an institution, without an active WP account, should not access to media directly by their URL)
    Thanks

    • Unfortunately, the plug-in does not provide that level of buttoned up security at this time.

  3. I’m using buddyPress. When I set the redirect page to a custom wordPress login page and then set the home page as the activity feed, it ignores the redirect page and still goes to the activity feed. Any ideas?

  4. Hi Jake,

    Is it possible to grant an access to an entire WP website to the African continent only ?
    Many thanks and happy new year !

  5. Hi,

    thanks for this great plugin. I don’t know if it is possible, but I have a feature suggestion.

    It’s probably been asked before, but: It would be good if an optional secret link could be generated. That unique variable encoded link would allow the visitior following it the same status as a logged in or ip restricted visitor.

    That would be very handy to be able to show clients their site without them having to log in or visit from our dedicated IP or temporarily make the site fully visible to all visitors. For our less technical clients this would be a boon.

    Just an idea and thanks again for this great free plugin, it is very handy :)

  6. Hello Jake, Great Plugin! Thanks. Just one question – Is there a way that I can allow unregistered users to see only 1 page, but lock the rest of the site down?

    Thanks,
    Simon.

    • Yep. One of the choices for blocking behavior allows you to select a page from your site to present to restricted visitors.

  7. Hello,

    I download the plugin and when i want to put the ip address on “Unrestricted IP addresses” fill. It doen’t work ?
    I have WP 3.8 version PHP 5.3

    Thanks a lot !

    • My honest guess? You’re putting in the wrong IP address. Are you putting in your local IP address, or your WAN IP address (try whatismyip.com).

      • I have the same problem – however, it’s not the wrong IP address that’s an issue.
        Problem is that the form isn’t submitting:
        http://screencast.com/t/yHF43vqx

        I’ve tried to disable all other plugins and used 3 different browsers, but I simply cannot add any IP address.

        Any idea what’s wrong?

        • Definitely never seen this before. It seems to think that’s not a valid IP address. I’ll investigate.

  8. I’m using your plugin quite often, but i have problems with uploaded images. With some images, the image doesn’t appear and i get a 403 error. If i delete your plugin, the images are appear properly. Do you have any suggestions?

    • No idea! Might be a limited resource issue with your server, but very odd that its would only happen when loading images.

  9. Hi there. We are currently trying to create our site to be similar to an intranet. Available without login if you are on an unrestricted IP address, available with a login for any other IP address. All the reviews we read said that your plugin works perfectly for this, but we are having issues. I’m concerned that it is because we are on WP 3.8 and this plug-in hasn’t been tested for that yet. Can you please advise? Thanks.

    • It is compatible with 3.8.

  10. Hi Jake,

    Thanks so much for this plug-in!

    For my pre-launch website, I’d like to know whether to use the redirect or replace option (so visitors see a landing page, unless they log in). I believe it would be ideal if the landing page was gaining search engine traction until we launch. Which is better for SEO — redirect or replace? Or no difference?

    Thanks!

    • I’m not sure what “replace” is referring to?

  11. Hi there, I wonder if it’s possible to re-direct logged in users (immediately after login), to the frontpage of the website instead of re-directing to the user’s profile page?
    I have tried the “Redirect them to a specified web address”, but they are still re-directed to their user profiles.
    Thanks for your help.
    best regards
    Peter

    • Yes… but that’s not what this plugin does. There are filters (hooks for code) in WordPress that can override where the logged in user lands after successfully logging in. There may be plugins to facilitate this, too.

  12. Is this plugin compatible with WordPress 3.8.1? From reading what this plugin does, it sounds like it would be the perfect solution to what I need. But upon installation, it doesn’t appear to do anything.

    I’ve put in my list of IPs that are allowed, but I am still able to access the website from anywhere.

    • It’s definitely doing something on our sites running 3.8.1. Do you have any page caching plugins in place?

  13. Hi, your plugin works great for forcing all visitors to my Login page first. However, it also blocks users from getting to the Password Reset page if they forget their password. When a user forgets their password, a link is sent to their email where they can reset their password. But your plugin forces them to the Login page instead, and they can never change their password! Is there a workaround for this?

  14. Are you able to restrict certain pages and apposed to the whole website? If so i would love to try this plugin!

    • You can extend the plugin to do this with code, but out of the box we’re going for simple: it blocks the entire site.

      • Thanks for the reply, an references so i can look up how to do this?

  15. Hi,

    I’m trying to use the code you mention on the main wordpress page to restrict a single page:

    add_filter( ‘restricted_site_access_is_restricted’, ‘my_rsa_feed_override’ );

    function my_rsa_feed_override( $is_restricted ) {
    global $wp;
    // check query variables to see if this is the feed
    if ( ! empty( $wp->query_vars[‘feed’] ) )
    $is_restricted = false;

    return $is_restricted;
    }

    I’m wondering how to adapt this to a single page. I’ve tried the following but it’s not working:

    add_filter( ‘restricted_site_access_is_restricted’, ‘team_registry_override’ );

    function team_registry_override( $is_restricted ) {
    global $wp;
    // check to see if it’s my page
    if ( is_single( ‘teammemberregistry’ ) )
    $is_restricted = false;

    return $is_restricted;
    }

    Best,
    Biagio

  16. I’m unable to add any new IPs. Plugin accepts the IP, but when I press save, the page refreshes without saving the IP just added. I have 984 IPs listed now – is there a limit to how many can be added using this plugin? Is there a fix? I’m using the newest version of the plugin and wordpress 3.8.1. Thanks!

    • Wow – that’s a lot of IPs. I have a feeling you’ve simply exhausted the length of the field we’re storing the IPs in!

  17. Hi Jake, thanks for this geat plugin!
    I want to have a restricted site to access it from my mobile, but I´m unable to login. I get a ‘forbidden’ error message even thoug I have added the mobile IP. I’m using Chrome in a Samsung Galaxy. It doesn’t matter if I try to login via wp-admin or wp-login. Do you know what can be causing it?
    Thank you very much

    • Sounds like an issue unrelated to the plugin: we don’t generate a “forbidden” message.

  18. Hi thanks for the plugin! Is it possible to configure the plugin so users with specific IP address go straight to the home page without logging in while other users would go to a custom login page? Thanks

    • Developers can implement this using the plugin’s action hooks.

  19. Hi!
    Thanks so much for this great plugin!
    Is there a way to limit a number of acces by IP?
    I need to authorize an IP to log for example 100 times, then block.
    Thanks

  20. I would like to use my no-ip address…
    Can you help me?

    • This is not officially supported. I believe no-IP just gives you a hostname to workaround dynamic IPs. The plugin doesn’t read / pay attention to hostnames.

Leave a Comment

Finely crafted websites & tools that make the web better.