IP Restriction

The IP Restriction add-on has two key features:

  1. You can whitelist IP addresses. Any IP addresses on the whitelist will be able to bypass content restrictions and gain full access to restricted content, even if they don't meet the requirements.
  2. You can also blacklist IP addresses. Any IP addresses on the blacklist will not be able to sign up through your Restrict Content Pro registration form.

Configuring the IP Restriction settings

The IP Restriction settings can be found in Restrict > IP Restriction.

IP Whitelist

The IP Whitelist option in the settings panel is a global setting. Any IP addresses entered here will be able to access all material on the site that is restricted through Restrict Content Pro, even if they don't meet the requirements.

IP Blacklist

Any IP addresses entered in this box will not be able to complete the Restrict Content Pro registration form. They will receive an error message whenever they attempt to submit it (see below).

Blacklist Error Message

This is the error message that will be shown to users who attempt to register for a subscription but are on the IP blacklist.

Configuring the whitelist for a membership level

IP addresses can also be whitelisted for a membership level. When you navigate to Restrict > Membership Levels you will find a new box for "IP Whitelist" when adding a new level or editing an existing one.

If you add an IP address to the whitelist here, members with that IP will gain access to any content that is restricted specifically to this subscription level. Here's an example:

Say you have one level called "Bronze" and another level called "Gold". You add the IP  216.3.128.12 to the whitelist on the Bronze membership level, then create a new page (Page #1) and restrict that page to members of the Bronze membership level only. If a user who is not logged in but has the IP address 216.3.128.12 visits your site, they will be able to access Page #1.

But let's say you create Page #2 and restrict it to members of the Gold membership level only. That same user will not be able to access this post, because they're only on the whitelist for the Bronze level and Bronze does not have access to this restricted post.

Configuring the whitelist for an individual post or page

When editing a post or page, you'll see a new metabox in the sidebar called "IP Restriction".

This allows you to configure the IP whitelist for this individual post or page only. You can enter an IP address (or multiple - one per line) in this box to grant users with that IP access to the content, even if they don't meet the criteria in the Restrict this content metabox.

Supported IP formats

For all IP whitelists and blacklists, one IP address should be entered per line. Both IPv4 and IPv6 are supported.

IP Restriction supports the following IP address formats in all IP inputs:

Single IP Addresses

Valid Examples:

226.216.136.78
207.174.243.113
59.229.72.176

Wildcards

All octets are not required.

Valid Examples:

200.122.216.* 
252.109.*.*  
186.*.*.*
186.*
149.58.*

Ranges

Enter an IP address for the start of the range, followed by a hyphen, followed by the end of the IP address range. Ranges are inclusive, which means the start and end of the range will be whitelisted.

Wildcards can be combined with ranges.

Valid Examples:

159.7.89.231-159.7.89.240
56.229.200.50-56.229.200.60
149.58.*-149.60.*

When combining wildcards and ranges, all the wildcards in the first IP will be replaced with 0 and all the wildcards in the second IP will be replaced with 255. The IP will then be matched against that range.

For example, if you enter this range: 149.58.*-149.60.* it will be turned into: 149.58.0.0-149.60.255.255.

CIDR Blocks

Valid Examples:

10.0.0.0/8
10.0.0.0/24