WordPress filter hook

woocommerce_admin_disabled

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

“Filter whether to disable admin tracking.”

How to use woocommerce_admin_disabled

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

functions.php
add_filter( 'woocommerce_admin_disabled', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

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

9 plugins that fire woocommerce_admin_disabled

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_admin_disabled', false ) includes/class-wc-tracker.php:361
  2. Google for WooCommerce icon Google for WooCommerce800,000+ installs apply_filters( 'woocommerce_admin_disabled', false ) src/Internal/Requirements/WCAdminValidator.php:38
  3. WooPayments: Integrated WooCommerce Payments icon WooPayments: Integrated WooCommerce Payments800,000+ installs apply_filters( 'woocommerce_admin_disabled', false ) includes/class-wc-payments-dependency-service.php:144
  4. Pinterest for WooCommerce icon Pinterest for WooCommerce200,000+ installs apply_filters( 'woocommerce_admin_disabled', false ) class-pinterest-for-woocommerce.php:515
  5. 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_admin_disabled', false ) includes/brikpanel-wc-compat.php:448
  6. CoCart icon CoCart900+ installs apply_filters( 'woocommerce_admin_disabled', false ) includes/classes/class-cocart-helpers.php:1024
  7. Sync orders with Xero from WooCommerce icon Sync orders with Xero from WooCommerce100+ installs apply_filters( 'woocommerce_admin_disabled', false ) inc/classes/class-wp-xelation-dependency-service.php:170
  8. Hakeemify Debloater icon Hakeemify DebloaterFewer than 10 installs apply_filters( 'woocommerce_admin_disabled', false ) src/Scan/Scanners/WooCommerceScanner.php:333
  9. ReSpek Nature icon ReSpek NatureFewer than 10 installs apply_filters( 'woocommerce_admin_disabled', false ) respek_nature.php:235

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.