WordPress filter hook

woocommerce_product_variation_title_attributes_separator

Defined by WooCommerce and fired by 11 plugins in total, running on 7.2M+ sites between them.

“Filters the separator used between a variation product title and its attributes.”

How to use woocommerce_product_variation_title_attributes_separator

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_product_variation_title_attributes_separator', function( $value, $product ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

11 plugins that fire woocommerce_product_variation_title_attributes_separator

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) includes/data-stores/class-wc-product-variation-data-store-cpt.php:306
  2. Discount Rules for WooCommerce icon Discount Rules for WooCommerce100,000+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) v2/App/Helpers/Woocommerce.php:1913
  3. BEAR icon BEAR30,000+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) classes/models/products.php:1526
  4. WP All Import icon WP All Import20,000+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) libraries/importer/products/ImportProductBase.php:63
  5. UpsellWP icon UpsellWP5,000+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) app/Helpers/Product.php:417
  6. BrikPanel: WooCommerce Dashboard & Analytics, Abandoned Cart Recovery, Order Export, Inventory Management & Bulk Editor icon BrikPanel: WooCommerce Dashboard & Analytics, Abandoned Cart Recovery, Order Export, Inventory Management & Bulk Editor1,000+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) includes/brikpanel-str.php:414
  7. Empik for Woocommerce icon Empik for Woocommerce500+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) src/Product/Empik_WC_Product_Exporter.php:484
  8. PeachPay icon PeachPay300+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) peachpay.php:588
  9. Feed KuantoKusta for WooCommerce icon Feed KuantoKusta for WooCommerce100+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $variation ) includes/class-wc-feed-kuantokusta.php:871
  10. Rooster One icon Rooster One10+ installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product ) includes/dmm/modules/class-aieo-dmm-swatches-runtime.php:604
  11. PerfLocale icon PerfLocaleFewer than 10 installs apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $variation ) addons/woocommerce/PerfLocaleWooCommerce.php:2133

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.