Support » Plugin: Bad Behavior » [Plugin: Bad Behavior] How to remove version info and stuff when viewing source

  • Does anyone know how to remove the information that Bad Behavior places in wp_head? You can view the information when viewing source.

    <!– Bad Behavior 2.2.1 run time: 28.117 ms –>

    I want to remove it completely using something in functions.php, so I won’t have to worry about it if the plugin is updated.

    I tried this in my functions.php and it didn’t work:

    // Disable Bad Behavior showing in head source
    remove_action( ‘wp_head’, ‘bb2_insert_head’, 1);

    Here is the code from bad-behavior-wordpress.php

    // Cute timer display; screener
    function bb2_insert_head() {
    global $bb2_timer_total;
    global $bb2_javascript;
    echo “\n<!– Bad Behavior ” . BB2_VERSION . ” run time: ” . number_format(1000 * $bb2_timer_total, 3) . ” ms –>\n”;
    echo $bb2_javascript;


    add_action(‘wp_head’, ‘bb2_insert_head’);

    Thanks for any suggestions.

Viewing 1 replies (of 1 total)
  • Ok, I figured it out. But now I’m wondering if it causes any problems by removing it.

    Here’s is what you would put in your theme’s functions.php file:

    remove_action( 'wp_head', 'bb2_insert_head' );

    But there is this comment in the bad-behavior-generic.php file:

    // Screener
    // Insert this into the <head> section of your HTML through a template call
    // or whatever is appropriate. This is optional we'll fall back to cookies
    // if you don't use it.
    function bb2_insert_head() {
    	global $bb2_javascript;
    	echo $bb2_javascript;

    So my next question is, what are the negatives of removing it?

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Bad Behavior] How to remove version info and stuff when viewing source’ is closed to new replies.