How can we help?

Search for answers or browse our knowledge base.

Table of Contents

Getting started with CAPTCHA 4WP geoblocking

CAPTCHA 4WP enables you to manage form and comment submissions on your WordPress websites based on location. Setting up this feature is easy and straightforward. This guide will walk you through the entire process.

Step 1: Get an IPLocate.io API key

CAPTCHA 4WP uses IPLocate.io to determine a user’s location. IPLocate.io offers an API service that provides geographic information on visitors. CAPTCHA 4WP uses this API service to make calls to the service, which means you will need an IPLocatio.io API key.

To get your IPLocate.io API key, you need to set up an account, with the free version providing up to 1,000 verifications per day.
First, head to the IPLocate website and create an account by entering your email address and setting a new password.

Create your IPLocate account

Click on Sign Up to receive the confirmation email directly into your inbox.

Once you confirm your email, go to your My account page and click on Show API key, as shown in the screenshot below.

Show API key

Step 2: Integrate IPLocate

Now that we have the API key, we can integrate IPLocate.io with CAPTCHA 4WP. First, log in to your WordPress dashboard and navigate to CAPTCHA 4WP > Settings. Click on the Integrations tab, enter the API key from the previous step in the IPLocate API Key text box, and click on Save Changes.

Block or allow form submissions based on location

You can block or allow form submission based on location for any form that is protected by CAPTCHA. As such, you need to have CAPTCHA enabled on your WordPress website for geoblocking to work.

First, navigate to CAPTCHA 4WP > Form Placements and click on the Forms & Placements tab. Since geoblocking works alongside CAPTCHA, ensure that CAPTCHA is enabled on the forms you would like to enable geoblocking on.

Next, determine whether you want to allow or block submissions.

When you allow submissions, only submissions for the countries you specify are allowed. When you block submissions, submissions from any country are allowed except the ones that you explicitly specify.

Scroll down to the Do you want block/allow protected form submissions based on a users location? section and fill in the following:

  • Location rule: Choose whether you want to:
    • Do nothing: Deactivates form submission geoblocking
    • Block submissions from the below countries: Block submissions from the countries you list 
    • Allow only from the below countries only: Allow submissions from the countries you list only.
  • Applicable Country Codes: Enter the ISO Alpha-2 country code of the countries you want to block or allow.
Do you want block/allow protected form submissions based on a users locations?

Click Save Changes for the settings to take effect.

Comment form handling based on geolocation

CAPTCHA 4WP also enables you to set action-based comment-handling behavior based on the commentator’s geographic location.

Navigate to CAPTCHA 4WP > Form Placements, click on the Comment Forms Settings tab, and enter the below information:

  • Country Codes: Enter the ISO Alpha-2 country code of the countries you want the comment handling rules to apply to.
  • Comment Handling: Choose whether you want to:
    • Do nothing: Deactivates form submission geoblocking
    • Allow comments from the above countries only:  Allow comments from the countries you list only.
    • Send comments from the above countries to spam: Send comments from the countries you list to spam
    • Mark comments from the above countries for moderation: Send comments from the countries you list for moderation
    • Block comments from the above countries only and show the below message: Block comments from the countries you list and show the message in Comment Blocked Message
  • Comment Blocked Message: Enter the message you want to display to users whose comments are blocked
Comment Blocked Messages

Click Save Changes for the settings to take effect.