Remove tags from wordpress head

I believe a filter on the_generator will do it.

add_filter( 
  'the_generator', 
  '__return_empty_string',
  PHP_INT_MAX
);

Reference:
https://codex.wordpress.org/Function_Reference/_return_empty_string.
https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/general-template.php#L2956

error code: 523