Remove WP Version Number

September 23, 2016 (4 years ago)
WordPress, Best Practices, Functions

Prevent robot scrapers from easily finding out which version of¬†WordPress you’re running.

Not a substitute for keeping WP updated, but a handy fallback for clients who may not.

/* remove WP version number */
if ( ! function_exists( 'dnlt_remove_wp_version' ) ) {
    add_filter( 'the_generator', 'dnlt_remove_wp_version' );

    function dnlt_remove_wp_version() {
        return '';
    }
}

 

Skip to toolbar