Skip to main content

Product selection and filtering

Default Behavior

By default, Free Downloads for WooCommerce automatically applies to all free downloadable products. However, you have several options to control which products are included or excluded.

The plugin automatically detects products that meet these criteria:

  • ✅ Price is exactly 0 (zero)
  • ✅ Product is marked as Downloadable
  • ✅ Product is marked as Virtual
  • ✅ At least one downloadable file is attached

Any product meeting all these criteria will automatically show download buttons instead of "Add to Cart".

Include Sale Products

By default, products that are on sale for free (regular price > 0, sale price = 0) are not included. You can change this behavior.

Why Exclude Sale Products?

Products on sale for free can cause issues:

  • Temporary promotions: Sale ends, but download button remains
  • WooCommerce download method conflicts: Especially with "Redirect" method
  • Inventory management: Sale products may have stock limitations
  • Unintended behavior: May not be truly "free" products

Enable Sale Products

To include products on sale for free:

  1. Go to WP Enhanced > Free Download Woo
  2. Click General in the sidebar
  3. Check Include paid items that are currently on sale for free
  4. Save changes
warning

This is not recommended if you use the "Redirect" WooCommerce download method. It can cause conflicts with how WooCommerce handles sale products.

How It Works

When enabled:

  • Products with regular price > 0 and sale price = 0 are included
  • Download buttons appear during the sale period
  • When sale ends, "Add to Cart" returns automatically
  • All other plugin features work normally

Select Specific Products Only

Instead of automatically including all free products, you can manually select which products to include.

Enable Product Selection Mode

  1. Go to WP Enhanced > Free Download Woo, then click General in the sidebar
  2. Check Include selected products only
  3. Save changes

Once enabled, no products will have download buttons until you explicitly enable them.

Select Products to Include

After enabling product selection mode:

  1. Edit a product in WooCommerce
  2. Scroll to the Free Downloads settings box (right sidebar)
  3. Check Include this product
  4. Update the product

Only products with this checkbox enabled will show download buttons.

When to Use Product Selection

Use product selection mode when:

  • You have many free products but only want some to bypass checkout
  • You want precise control over which products use the plugin
  • You're testing the plugin on specific products first
  • You have free products that should still go through checkout
  • You want to gradually roll out the feature

Don't use product selection mode when:

  • You want all free products to have download buttons
  • You have few free products (easier to manage automatically)
  • You want the plugin to work automatically

Exclude Specific Products

If you want most free products to use download buttons but need to exclude a few, use product selection in reverse.

Method 1: Make Product Not Free

The simplest way to exclude a product:

  1. Set the price to 0.01 (or any non-zero amount)
  2. The plugin will ignore it
  3. "Add to Cart" button will appear normally

Method 2: Remove Downloadable/Virtual Flags

Another way to exclude:

  1. Uncheck Downloadable or Virtual
  2. The plugin will ignore it
  3. Product will behave like a normal WooCommerce product

Method 3: Use Product Selection Mode

For more control:

  1. Enable Include selected products only
  2. Manually select which products to include
  3. Leave excluded products unchecked

Method 4: Use Custom Code

For developers, use the somdn_is_free_download filter:

add_filter('somdn_is_free_download', function($is_free, $product_id) {
// Exclude specific product IDs
$excluded_ids = [123, 456, 789];

if (in_array($product_id, $excluded_ids)) {
return false;
}

return $is_free;
}, 10, 2);

See Advanced: Filters for more details.

Product Categories and Tags

You can use WooCommerce categories and tags to organize free downloads, but the plugin doesn't filter by category/tag directly.

Organize with Categories

Create categories for your free downloads:

  • Free eBooks
  • Free Templates
  • Free Courses
  • Free Resources

This helps customers find free downloads but doesn't affect plugin behavior.

Filter by Category (Custom Implementation)

To include/exclude products by category, use custom code:

add_filter('somdn_is_free_download', function($is_free, $product_id) {
// Only include products in "Free Downloads" category
if (has_term('free-downloads', 'product_cat', $product_id)) {
return $is_free;
}

return false;
}, 10, 2);

Product Attributes

You can use product attributes to add metadata to free downloads, but they don't affect plugin behavior directly.

Useful Attributes

  • File Size: Show file size in product attributes
  • File Format: PDF, ZIP, MP3, etc.
  • Version: Track version numbers
  • License: GPL, MIT, Creative Commons, etc.

These attributes display on the product page and help customers make informed decisions.

Bulk Product Management

Enable Plugin for Multiple Products

To enable the plugin for many products at once:

  1. Enable Include selected products only mode
  2. Use a bulk edit plugin or custom script
  3. Or manually edit products one by one

Disable Plugin for Multiple Products

To disable the plugin for many products:

  1. Bulk edit products to set price to 0.01
  2. Or bulk remove Downloadable/Virtual flags
  3. Or use custom code with product IDs

Product Visibility

The plugin respects WooCommerce product visibility settings:

  • Catalog visibility: Hidden products won't show in shop
  • Featured products: Work normally with the plugin
  • Private products: Require login to view
  • Password protected: Require password to view

All visibility settings work as expected with free downloads.

Product Stock Management

Virtual Products

Free downloads should be marked as Virtual, which:

  • Removes shipping options
  • Removes stock management (usually)
  • Simplifies the product page

Stock Management

If you need to limit downloads using stock:

  1. Enable stock management on the product
  2. Set stock quantity
  3. When stock reaches 0, product becomes unavailable
  4. Download button is replaced with "Out of stock"
info

For better download limiting, use the Pro edition's Download Limits (Pro) feature instead of stock management.

Troubleshooting Product Selection

Product Not Showing Download Button

If a product should have a download button but doesn't:

  1. ✅ Verify price is exactly 0
  2. ✅ Check Downloadable is enabled
  3. ✅ Check Virtual is enabled
  4. ✅ Ensure at least one file is attached
  5. ✅ If using product selection mode, check Include this product is enabled
  6. ✅ Clear all caches

Wrong Products Showing Download Button

If products that shouldn't have download buttons do:

  1. ✅ Check product price (should be > 0 to exclude)
  2. ✅ Verify sale products setting if applicable
  3. ✅ Use product selection mode for precise control
  4. ✅ Check for custom code affecting behavior

Sale Products Not Working

If sale products don't show download buttons when enabled:

  1. ✅ Verify Include paid items on sale for free is checked
  2. ✅ Check sale price is exactly 0
  3. ✅ Ensure sale dates are active
  4. ✅ Verify product is still Downloadable and Virtual
  5. ✅ Clear caches

Best Practices

Product Organization

  • Use categories: Organize free downloads into logical categories
  • Use tags: Tag products for easy filtering
  • Use attributes: Add metadata like file size, format, version
  • Use featured: Highlight popular free downloads

Product Selection Strategy

Automatic Mode (Default):

  • ✅ Best for most sites
  • ✅ Works automatically
  • ✅ Easy to maintain
  • ✅ Scales well

Manual Selection Mode:

  • ✅ Precise control
  • ✅ Good for testing
  • ✅ Gradual rollout
  • ❌ More maintenance
  • ❌ Easy to forget to enable

Sale Products

  • Avoid if possible: Sale products can be confusing
  • Use dedicated free products: Create separate products for free downloads
  • Test thoroughly: If using sale products, test the entire flow
  • Monitor closely: Watch for issues when sales end

Product Naming

  • Be clear: "Free eBook: Getting Started" is better than "eBook 1"
  • Include "Free": Helps customers identify free products
  • Describe content: Make it clear what they're downloading
  • Use consistent naming: Follow a naming convention

What's Next