How to block countries in MemberPress?

MemberPress

Running a membership site with MemberPress often means handling sensitive user data, subscription sign-ups, and payment forms. But what if a flood of spam registrations or unwanted traffic keeps coming from certain regions?

Unfortunately, MemberPress does not include built-in tools to block countries or filter users by their location. But you still have two ways to do it:

  1. Add OOPSpam Anti-Spam to MemberPress for form-level filtering.
  2. Use Cloudflare’s Web Application Firewall (WAF) to block access site-wide.

Let’s look at how both solutions work.

Why MemberPress Alone Isn’t Enough

While MemberPress is excellent for memberships and access control, it does not natively support country-based restrictions for forms or logins. That means if you want to stop spam sign-ups or restrict access to certain countries, you’ll need external tools.

The good news: with OOPSpam and Cloudflare, you can block countries either at the form level (precision filtering) or at the network level (site-wide).

Option 1: Block Countries in MemberPress with OOPSpam

OOPSpam Anti-Spam (that’s us 👋) integrates smoothly with WordPress and works alongside MemberPress to protect registration, checkout, and contact forms.

OOPSpam Anti-Spam

What OOPSpam Brings to MemberPress

This is the easiest way to deal with fake sign-ups, spammy membership attempts, or repeated abuse from certain regions.

How to Set It Up

Step 1: Install OOPSpam

Go to your WordPress dashboard, open Plugins > Add New, search for OOPSpam Anti-Spam, then install and activate it.

OOPSpam

Step 2: Connect Your API Key

Create an account at OOPSpam.com, generate your API key, and paste it into OOPSpam Anti-Spam > Settings in your WordPress dashboard.

Connect Your API Key

Step 3: Enable MemberPress Protection

In the plugin settings, find the MemberPress section and toggle protection on. This ensures all MemberPress forms (registration, checkout, and login) are filtered.

MemberPress Spam Protection

Step 4: Block or Allow Countries

Open the Country Filtering panel. Choose whether to block submissions from selected countries or allow only specific ones. Save your settings to activate the filter.

Block or Allow Countries

Step 5: Review Logs

Blocked and approved entries appear in two places: inside WordPress under the Spam & Ham Logs (showing rejected vs. accepted entries)

Logs

and in the OOPSpam Dashboard, which provides detailed filtering reports for deeper analysis.

OOPSpam Dashboard logs

Option 2: Block Countries Site-Wide with Cloudflare

Sometimes spam goes beyond just form entries. You may face:

In these cases, Cloudflare’s Web Application Firewall (WAF) lets you block entire countries before they ever reach your site.

Unlike OOPSpam, this will block all traffic from the selected countries, not just MemberPress forms.

How to Use Cloudflare for Country Blocking

How to Use Cloudflare for Country Blocking

Step 1: Log into Cloudflare

Go to cloudflare.com and select the domain where your MemberPress site is hosted.

Step 2: Create a Firewall Rule

From now on, visitors from those countries will not be able to access your website at all.

Which Should You Use?

Method What It Blocks Best For
MemberPress Built-In Not Available Not an option
OOPSpam Plugin Form submissions only Membership sign-up spam, checkout spam
Cloudflare Firewall Entire website Broad attacks, compliance restrictions, or region-wide bans

Final thoughts

With OOPSpam Anti-Spam, you can filter registrations and form submissions at the membership level, while Cloudflare WAF gives you the ability to shut down site-wide attacks or unwanted traffic.

For most site owners, OOPSpam will be the first line of defense, giving precise and transparent filtering without disrupting normal visitors. If stronger protection is needed, combining OOPSpam with Cloudflare ensures you have both form-level control and network-level security.

Need help setting things up? Visit OOPSpam documentation for more resources.

Spam Protection for WordPress, Zapier, Make and more.

Since our launch in 2017 we’ve been perfecting our API to be the trusted option for small businesses to enterprise— and continue to stick to our values of being the accessibility and privacy-friendly option. Give us a shot!

Try OOPSpam for free → Try our WordPress plugin for free →

✓ No credit card required ✓ Cancel anytime

Enjoy Reading This Article?

Here are some more articles you might like to read next: