WordPress.org

Ready to get started?Download WordPress

Forums

Bad Behavior
How to remove version info and stuff when viewing source (2 posts)

  1. MickeyRoush
    Member
    Posted 2 years ago #

    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;
    }

    and

    add_action('wp_head', 'bb2_insert_head');

    Thanks for any suggestions.

    http://wordpress.org/extend/plugins/bad-behavior/

  2. MickeyRoush
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic