
Chazie Baniquid
Technical Content Marketer
5 minutes to read
How to block countries in 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:
- Add OOPSpam Anti-Spam to MemberPress for form-level filtering.
- 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.
What OOPSpam Brings to MemberPress
- Country Filtering – Decide which countries to block or allow for form submissions.
- Language Filtering – Block sign-ups in specific languages.
- Spam & Abuse Detection – machine learning-powered filtering to stop bots and automated sign-ups.
- Block Proxies, VPNs, and TOR – Stops anonymous traffic sources.
- Rate Limiting – Control how often users can submit forms to prevent abuse.
- Submission Logs – See blocked vs. allowed entries with reasons for transparency.
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.
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.
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.
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.
Step 5: Review Logs
Blocked and approved entries appear in two places: inside WordPress under the Spam & Ham Logs (showing rejected vs. accepted entries)
and in the OOPSpam Dashboard, which provides detailed filtering reports for deeper analysis.
Option 2: Block Countries Site-Wide with Cloudflare
Sometimes spam goes beyond just form entries. You may face:
- DDoS attacks
- Brute-force login attempts
- Data scraping
- Excessive junk traffic
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
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
- Navigate to Security > WAF > Firewall Rules
- Click Create Firewall Rule
- Name it something like “Block Countries”
-
Configure as follows:
- Field: Country
- Operator: is in
- Value: Select the countries you want to block
- Action: Block
- Save and deploy
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.