Home / Disable / Block WPCode Conversion Pixels Facebook
Duplicate Snippet

Embed Snippet on Your Site

Block WPCode Conversion Pixels Facebook

This snippet blocks the Facebook pixel added by the WPCode Conversion Pixels addon from being loaded on any page. Use the Conditional Logic to choose where this snippet should not be loaded to control where the pixel will be loaded.

<10
Code Preview
php
<?php
add_filter('wpcode_get_snippets_for_location', function( $snippets, $location) {
	if ( 'site_wide_header' !== $location ) {
		return $snippets;
	}
	// Let's remove any snippet with the id of pixel_facebook.
	$snippets = array_filter( $snippets, function( $snippet ) {
		return 'pixel_facebook' !== $snippet->id;
	} );
	return $snippets;
}, 15, 2 );

Comments

Add a Comment