Turn Off Order Attribution Tracking
Stops WooCommerce's order attribution script from setting tracking cookies and recording the visit source of each order, useful under strict cookie policies.
Opens WPIDE on
Code
add_filter( 'wc_order_attribution_allow_tracking', '__return_false' );
add_action( 'wp_enqueue_scripts', function () {
wp_dequeue_script( 'wc-order-attribution' );
wp_dequeue_script( 'sourcebuster-js' );
}, 100 );
Notes
Origin details stop appearing on new orders; the same switch also lives under WooCommerce > Settings > Advanced > Features.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.