Home / Disable / Disable WPCode Conversion Pixels addon global scripts
Duplicate Snippet

Embed Snippet on Your Site

Disable WPCode Conversion Pixels addon global scripts

This snippet will prevent the site-wide snippets added by the WPCode Conversion Pixels addon from being loaded.

Please note that the global scripts have to be loaded separately or the pixel snippets will throw errors.

<10
Code Preview
php
<?php
add_filter( 'wpcode_get_snippets_for_location', function ( $snippets, $location ) {
	if ( 'site_wide_header' !== $location ) {
		return $snippets;
	}
	foreach ( $snippets as $key => $snippet ) {
		if ( ! is_int( $snippet->id ) && false !== strpos( $snippet->id, 'pixel_' ) ) {
			unset( $snippets[ $key ] );
 		}
	}
	return $snippets;
}, 15, 2 );

Comments

Add a Comment