How to block countries in Ninja Forms?

Ninja Forms

If you’re using Ninja Forms, you may have noticed there’s no built-in option to block form entries by country or IP address. That doesn’t mean you’re stuck with spam, you can still filter unwanted submissions with the right tools.

Below, I’ll walk you through two effective ways to block countries in Ninja Forms:

  1. Using OOPSpam Anti-Spam for country-based form filtering
  2. Using Cloudflare Firewall Rules to block entire countries from your website

No Built-In Country Blocking in Ninja Forms

Ninja Forms is a powerful form builder, but it doesn’t provide native functionality for blocking submissions based on country or IP location.

That means if spam is coming from specific regions, you’ll need an external solution to handle it. The most flexible and non-intrusive method is to integrate Ninja Forms with OOPSpam Anti-Spam (that’s us 👋). This plugin works seamlessly with Ninja Forms, adding real-time spam detection, country and language filtering, and detailed submission logs to your WordPress dashboard.

1. Block Countries in Ninja Forms Using OOPSpam

If spam entries are draining your time, OOPSpam is the easiest way to shut them down. It brings advanced filtering tools into WordPress and connects directly with Ninja Forms.

OOPSpam Anti-Spam

What OOPSpam Adds to Ninja Forms

When paired with Ninja Forms, OOPSpam gives you:

How to Set It Up

Here’s a step-by-step guide to enable country-based blocking in Ninja Forms:

Step 1: Install the OOPSpam Plugin

OOPSpam

In your WordPress dashboard, go to Plugins > Add New and search for “OOPSpam Anti-Spam”. Install and activate the plugin.

Step 2: Connect Your API Key

Connect Your API Key

Step 3: Enable Ninja Forms Protection

Enable Ninja Forms Protection

Scroll to the Ninja Forms section in OOPSpam settings and turn on spam protection for Ninja Forms. This ensures every form submission goes through OOPSpam’s filters.

Step 4: Block or Allow Countries

Block or Allow Countries

Go to Country Filtering inside OOPSpam settings and choose either:

Select the countries from the dropdown list and Save.

Now, OOPSpam will automatically block form entries from the selected regions, without preventing visitors from browsing your site.

Reviewing Blocked Submissions in Ninja Forms

One major advantage of OOPSpam is transparency. You can review exactly what was blocked and why. You’ll see:

Blocked and approved entries appear in two places:

Ninja Forms Spam & Ham Logs

OOPSpam Dashboard logs

This makes it easy to detect abuse patterns, fine-tune filters, and recover valid leads if necessary.

2. Block Entire Countries from Your Website with Cloudflare

If your issue goes beyond Ninja Forms spam, like DDoS attacks, brute force logins, or scraping, then blocking at the network level may be more effective.

This is where Cloudflare’s Web Application Firewall (WAF) comes in.

⚠️ Note: Unlike OOPSpam, this method blocks visitors from accessing your entire website, not just Ninja Forms submissions.

How to Set Up Country Blocking in Cloudflare

Set Up Country Blocking in Cloudflare

Step 1: Log Into Cloudflare

Go to cloudflare.com and log in. Select the site where Ninja Forms is installed.

Step 2: Create a Firewall Rule

Now, visitors from those countries will be completely denied access to your site.

When to Use Cloudflare Blocking

Cloudflare is best for:

Final thoughts

Ninja Forms doesn’t come with built-in country blocking. But with OOPSpam, you can easily filter submissions by region, stop spam, and review detailed logs, without disrupting normal site visitors.

For broader protection, layer OOPSpam with Cloudflare Firewall Rules. Together, they give you flexible control over who can interact with your site.

And the best part? OOPSpam works not only with Ninja Forms but also with other builders like Piotnet Forms, Kadence Form, MailPoet, Elementor Forms, and more.

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: