This is especially helpful if you’re using an older version of WordPress. Best not tell anyone else that you are.

 
function no_generator() { return ''; } 
add_filter( 'the_generator', 'no_generator' );