How to block countries in Ultimate Member?

Ultimate Member

Ultimate Member does not support country blocking on its own. To stop unwanted registrations, spam, or abusive traffic, you’ll need to use a third-party tool. The easiest solution is the OOPSpam Anti-Spam plugin (that’s us 👋), which lets you block specific countries at the form level. For wider protection beyond Ultimate Member, you can use Cloudflare Firewall Rules to block traffic from entire countries before they reach your site.

Why Ultimate Member Doesn’t Do This Directly

Ultimate Member is built for user management, not traffic blocking. 

It focuses on creating profiles, handling registrations, and restricting content by roles. Security controls like country blocking aren’t part of its core features because these are typically handled by security plugins or your hosting provider’s firewall.

Most importantly, this means you’ll need a separate plugin or a network-level firewall to block spam or access from unwanted countries.

Option 1: Block Countries in Ultimate Member Forms with OOPSpam

OOPSpam gives you direct control over form submissions.

It integrates with WordPress forms, including Ultimate Member, and lets you decide which countries can submit registrations or login attempts.

Key Features include:

How to Set It Up

Install the OOPSpam Anti-Spam plugin from your WordPress dashboard. Create an account at OOPSpam.com and generate an API key.

OOPSpam Anti-Spam

Go to OOPSpam Anti-Spam > Settings and paste your API key.

OOPSpam Anti-Spam > Settings

Enable protection for Ultimate Member forms in the settings.

Enable protection for Ultimate Member forms in the settings.

Scroll to the Country Filtering section under the General Settings tab and select the countries to block or allow.

Country Filtering section

Save changes and review blocked entries under Spam & Ham logs in WordPress.

Spam & Ham logs in WordPress

For deeper insights, visit the OOPSpam Dashboard where you’ll see reports, blocking reasons, and spam trends over time.

OOPSpam dashboard logs

Option 2: Block Entire Countries with Cloudflare

If your issue is bigger than spam, use Cloudflare Firewall.

Cloudflare lets you block traffic at the network level, stopping attacks before they even reach your WordPress site.

How to Do It

Block Entire Countries with Cloudflare

  1. Log in to your Cloudflare account.
  2. Go to Security > WAF > Firewall Rules.
  3. Create a new rule and name it “Block Countries.”
  4. Set the field to Country, operator to is in, and select the countries to block.
  5. Choose Block as the action, then save.

Visitors from those countries will now be denied access to your entire site, not just Ultimate Member forms.

Final thoughts

The main takeaway is this:

Together, these tools give you the flexibility and protection that Ultimate Member alone cannot provide, keeping your site safer while still letting the right users in.

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: