Disable Points for Specific Products

You can disable points earning for specific products using the wpgens_loyalty_disable_product_points filter:

add_filter('wpgens_loyalty_disable_product_points', function($disabled, $product) {
    // Disable points for product ID 123. Replace 123 with your product ID.
    if ($product->get_id() === 123) {
        return true;
    }

    // Disable points for the shoes product category. Replace shoes with a desired category name.
    if (has_term('shoes', 'product_cat', $product->get_id())) {
        return true;
    }

    return $disabled;
}, 10, 2);

This filter allows you to:

  • Disable points for specific product IDs
  • Disable points for products in certain categories
  • Disable points based on any custom logic you need

The filter receives two parameters:

  • $disabled (boolean): Current disabled status
  • $product_id (int): The product ID to check

Return true to disable points for the product, false to allow points.

Browse our plugins

Lightweight WooCommerce plugins built for speed. No bloat, no frameworks -- just clean code that works.

View all plugins