Block WooCommerce Bot Orders & Credit Card Testing Scams

Getting hit with fake WooCommerce orders or card testing scams? In this video I’ll show you how to block bots by adding a simple code snippet. This quick fix helps protect your store, reduce fraud, and keep your checkout safe.

Code Snippet Credit

Get Elementor Pro

Timestamps:

  • 2:24 Enable Rate Limit Checkout
  • 4:10 Add Code Snippets

Code Snippets

				
					/** disable wc_endpoint to stop carding attacks **/
function disable_wc_endpoint_v1() {
    $current_url = $_SERVER['REQUEST_URI'];
    if (strpos($current_url, '/wp-json/wc/store/v1/checkout') !== false) {
        wp_redirect(home_url('/404.php'));
        exit;
    }
}
add_action('rest_api_init', 'disable_wc_endpoint_v1');

/** disable wc_endpoint to stop carding attacks **/
function disable_wc_endpoint() {
    $current_url = $_SERVER['REQUEST_URI'];
    if (strpos($current_url, '/wp-json/wc/store/checkout') !== false) {
        wp_redirect(home_url('/404.php'));
        exit;
    }
}
add_action('rest_api_init', 'disable_wc_endpoint');
				
			

Free Brand Messaging Worksheet

Define Your Voice and Connect with Your Audience

More Free Resources

Let's Work Together

Big ideas start with a quick chat. Let’s talk!