This article is dedicated to the premium IP Check add-on 4.1.0 or higher that is available for purchase from our online store.
For the geo-lookup, IP Check uses ipstack service. You must have to have at least free-tier account in order to define geo-based access rules. For more information about setting up geo-lookup, refer to the “How to manage access to WordPress website based on location” article.
Sometimes there is a need to restrict access to a WordPress website for users based on referred host, IP address or even physical geographical location. With IP Check add-on this task is easier than ever.
Upon add-on activation, a new tab “IP Check” is added to the list of AAM features and on this tab, you have an option to define an unlimited number of rules that either allow or deny access to the entire website if matched.
In addition to that, a new access option is available on the Posts & Terms tab called REFERENCE CHECK. This option allows defining access to your content based on a user’s IP or geographical location.
Below we are going to cover all existing types of rules that can be defined with IP Check add-on so you can make a better choice on which one fits your requirements better.
IPv4 a user’s IP address. You can define either complete IP address, mask * or range 0-255. AAM expects that IP address contains 4 octets when any octets can have a mask * (all numbers between 0-255), valid range (any numbers between 0-255) or explicit number between 0-255. For example following IPs are valid: 184.108.40.206, 10.*.79.*, 71.*.20-40.1, *.*.*.*
A valid domain name that a user comes from. Basically, if there is some website example.io that contains a link to your protected site, then you can create a rule that will allow/deny access to it if a user clicked on that link.
Manage access to the site based on the query parameter in the URL. By default, AAM looks for ref param, however this behavior can be customized with ipcheck.query.param ConfigPress option. This option is quite useful when you want to grant access to specific website resources based on some authorization code in your URL (e.g. https://mywebsite.com/protected-area?ref=uiiw34721)
Note! All other options below, require at least a free-tier ipstack account. For more information about setting up geo-lookup, refer to the “How to manage access to WordPress website based on location” article.
Define access rules based on a user’s country name. ipstack services uses “ISO 3166-1 alpha-2” standards for the country naming. It is important to enter the correct country name, however, it can be case-insensitive.
Define access rules based on user’s 2 letters country code. ipstack services uses “ISO 3166-1 alpha-2” standards for the country code. It is important to enter the correct country code, however, it can be case-insensitive.
Define access rules based on a user’s geographical continent. The following names are accepted: Africa, Asia, Europe, North America, Oceania, South America, Antarctica.
Define access rules based on a user’s region code of the region associated with the IP (e.g. CA for California).
Define access rules based on a user’s region name associated with the IP (e.g. North Carolina, Kyiv City).
Define access rules based on a user’s city name associated with the IP (e.g. New York, London, Tokyo).
Define access rules based on a user’s zip code associated with the IP (e.g. 28202, 01000).
How to manage rules
To add a new rule, go to IP Check tab and click on the “+ Create” button. This will bring the “IP Check Rule” modal where you can select the rule type, enter a value and define access mode allowed or denied.
IP Check rules are evaluated in a specific order where all denied rules are evaluated before allowed rules. This way you can deny access to all IP addresses or hosts and override it for few.