Snippets

Move Bad Behavior javascript to footer

The WP plugin ‘Bad Behavior’ is a popular way to keep spambots and unwanted traffic off your website. Unfortunately, the plugin inserts javascript in the header. A simple piece of code added to functions.php moves the javascript to the footer of your website. Add the code to functions.php and click Save. Reload your WordPress site and check the footer.

// move Bad Behavior javascript to footer
remove_action('wp_head', 'bb2_insert_head');
add_action('wp_footer', 'bb2_insert_head');

Share this snippet