Last active
August 29, 2015 13:56
-
-
Save DavidWells/8792842 to your computer and use it in GitHub Desktop.
Remove tracking from all forms on a given page for WordPress Leads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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