Skip to content

Instantly share code, notes, and snippets.

@DavidWells
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidWells/8792842 to your computer and use it in GitHub Desktop.
Save DavidWells/8792842 to your computer and use it in GitHub Desktop.
Remove tracking from all forms on a given page for WordPress Leads
<?php
// Add to your themes function.php file without the opening <?php tag
add_action('wp_head', 'kill_form_tracking_for_specific_pages')
if (!function_exists('kill_form_tracking_for_specific_pages')) {
function kill_form_tracking_for_specific_pages(){
// targeting page ID 106. Replace with your specific page ID
if (is_page(106)) {
echo '<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery("form").each(function(){
jQuery(this).removeClass("wpl-track-me");
});
});
</script>';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment