How to Restrict WordPress Content Access by IP Addresses

PDA Access Restriction extension for Prevent Direct Access (PDA) Gold and Protect WordPress Pages & Posts (PPP) Gold plugin comes with 4 IP restriction key features:

How to Configure IP Addresses to Access Protected Content

While PPP Gold helps you prevent access to protected content based on user roles, PDA Access Restriction extension takes a step further and whitelist any IP addresses. It comes in useful when you want to restrict your protected content for internal access.

You can configure the whitelist on global as well as individual page level.

Requirements:

Whitelist IP access for global level

Once activating our plugins, go to Content Protection >> Restriction tab under your admin dashboard.

Simply enter the IP addresses which you want to bypass the protection provided by PPP Gold. Users from these IP addresses will be able to access all protected content on your site without having to log in.

Note that:

  • Only IPv4 addresses are supported
  • Asterisk (*) is used for will card matching, e.g. 1.1.1.* will match IP from 1.1.1.0 to 1.1.1.255

Whitelist IP access for individual page or post

Whitelisted IP addresses can also be configured on the individual level. You can specify different IP whitelists per page or disable this feature for certain pages.

You can do so by clicking on “Configure protection” button under “Content Protection” column in Pages or Posts screen.

It will bring up a window popup where you can protect this content and input IP addresses to whitelist.

You are offered 3 options including:

  • Use default setting
    • Follow the global-level whitelist in the plugin’s settings page
  • Disable IP Restriction
  • Allow these IP addresses only
    • Give the users from these IP addresses permission to access this content.

Note that:

  • Only IPv4 addresses are supported
  • Asterisk (*) is used for wildcard matching, e.g. 1.1.1.* will match IP from 1.1.1.0 to 1.1.1.255

You can whitelist IP access to not only pages and posts but also custom post types.

Let’s say you’re selling products specifically for the US market. You might want only users from US to access the protected product on your site.

You just have to add Product types to Post Type Protection option under PPP Gold settings page before setting whitelisted IP addresses.

Similar to content protection, there are some cases where you want to make your protected media files visible to internal access. By whitelisting their IP addresses, you can grant them permission to access your protected files without any login requirement.

Requirements:

Once activating our plugins, go to Prevent Direct Access Gold >> Settings menu under your admin dashboard.

Switch to IP Restriction tab and navigate to “Restrict access to protected links” section as image below:

Add the list of IP addresses to which you want to grant access to all media files protected by PDA Gold. People coming from these IP addresses will be able to see all your protected files without logging into your website.

You may want to share your protected files with certain people only. Apart from expiring the link by date and clicks, you can also restrict its access to certain IP addresses. Similarly, you can blacklist certain IP addresses from accessing your private files instead.

Requirements:

Once activating our plugins, you will see a new “Prevent Direct Access” column under Media Libary List View.

Simply click on “Configure file protection” button next to the file title of which you want to set IP blacklist. It will bring up a window popup where you can protect this file, create download private links as well as prevent specific IP addresses from accessing these links.

Click “Submit” once you’re done.

How to Restrict Access to Entire Website

This setting enables you to block all undefined IP addresses access to your whole site, from both backend and frontend.

Requirements:

Once activating our plugins, go to Prevent Direct Access Gold >> IP Restriction tab under your admin dashboard. You can find “Restrict access to the entire website” section at the bottom of this tab.

Simply enter those IP addresses that you want to access your website only. Don’t forget to add your current IP address to whitelist too.

Please note that once you whitelist these IP addresses, the rest of the world won’t be able to access your website. They’ll see this message instead:

These 2 PDA Gold features work best on Apache servers. Please drop us a support email if you’re using other types of servers.
Lasted updated on March 3, 2020