How to Block Orders by Billing Address in WooCommerce

The fastest way to block orders by billing address in WooCommerce is to install a dedicated anti-fraud plugin like OOPSpam Anti-Spam, enter the addresses, cities, or PO boxes you want to reject in its “Block orders with specific billing addresses” field, and save. No coding required. Alternatives include WooCommerce’s built-in Selling location(s) setting (country-level only) or a custom PHP snippet, but OOPSpam offers broader fraud coverage in one tool.

Why Repeat Fraudulent Addresses Keep Costing You Money

Fraudsters and bots often reuse the same fake billing details, like reshipping PO boxes or addresses tied to past chargebacks. Blocking these values at checkout stops repeat offenders before they order, saving you inventory, fees, and chargebacks.

Here are the top three ways to do it:

Option 1: OOPSpam Anti-Spam

OOPSpam (that’s us) is a WordPress plugin built specifically for spam and fraud prevention across forms, comments, and WooCommerce checkouts. Rather than relying on CAPTCHA (which frustrates real customers), it works quietly in the background, cross-checking orders against a database of over 500 million known malicious IPs and emails, plus machine learning analysis. The plugin has reportedly caught over a billion spam submissions to date.

For billing address specifically, OOPSpam lets you enter a list of addresses, cities, states, or PO boxes to block, and it automatically rejects any order whose billing address contains that text (matching is case-insensitive). 

This makes it useful against reshipping fraud, repeat chargeback customers, and known fake addresses.

Steps to set it up:

Install and activate the OOPSpam Anti-Spam plugin from your WordPress dashboard.

OOPSpam Anti-Spam

Sign up for a OOPSpam API key.

Sign up for a OOPSpam API key.

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

OOPSpam Anti-Spam settings

In the OOPSpam settings, find the WooCommerce section and turn on Activate Spam Protection.

Find the WooCommerce section and turn on Activate Spam Protection

Under Block orders with specific billing addresses, enter each address, city, or PO box on its own line (for example: 123 Fake Street, 456 Spam Avenue Suite 100, PO Box 999).

Block orders with specific billing addresses

Customize the customer-facing error message if you want a specific tone. Click Save changes.

Because OOPSpam bundles this feature alongside other protections, blocking specific order totals, country and language filtering, rate limiting, and blocking orders from unknown origin, you get a more complete fraud-prevention layer instead of a single-purpose tool. 

OOPSpam also stores rejected submissions locally in your WordPress database (under Form Spam Entries) so you can audit what was blocked and why, and it doesn’t use cookies or share your data, which is worth noting if privacy compliance matters to your business.

Form Spam Entries

Option 2: WooCommerce’s Built-In Selling Location(s) Setting

WooCommerce’s built-in Selling location(s) setting can restrict orders by country, but it doesn’t filter specific addresses. It’s a native, no-cost option worth knowing about, even though it’s not a true address-blocking tool.

WooCommerce's Built-In Selling Location(s) Setting

Steps:

  1. Go to WooCommerce > Settings, where the General tab opens by default.
  2. Under General options, find Selling location(s).
  3. Choose from Sell to all countries, Sell to all countries, except for…, or Sell to specific countries.
  4. Adjust Shipping location(s) to match, if needed.
  5. Click Save changes.

This setting is useful for broad, country-level restrictions and quick compliance needs, but it has no field for blocking a specific street address, city, or PO box. If your goal is to stop orders from a known bad address rather than an entire country, you’ll need OOPSpam, a dedicated extension, or the PHP snippet below.

Option 3: Custom PHP Snippet

For a code-based approach, developers can add a validation function to their theme’s functions.php file or a code snippets plugin. This example blocks a specific billing city:

add_action( 'woocommerce_checkout_process', 'block_orders_by_billing_address' );

function block_orders_by_billing_address() {
    $blocked_city = 'ExampleCityName';

    if ( isset( $_POST['billing_city'] ) && $_POST['billing_city'] === $blocked_city ) {
        wc_add_notice( __( 'Orders from this billing location are not accepted.', 'woocommerce' ), 'error' );
    }
}

This method is free but requires ongoing maintenance, manual updates to your blocklist, and some PHP knowledge. It also won’t survive a theme update unless placed in a child theme or snippets plugin.

Which Option Should You Choose?

Blocking known bad billing addresses is a simple, effective first step in reducing spam orders and fraud. Pairing it with a dedicated tool like OOPSpam gives your store a stronger, more automated defense without adding friction for legitimate customers.

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: