I tried this once before but it didn’t work — WordPress will ultimately try to add a generator meta tag. Since I use the infamous Hybrid Core, my situation was a little different.
In hybrid-core/hybrid.php
, there’s an action hooked up to after_setup_theme
that runs default_filters
. Here’s a snippet:
/* Move the WordPress generator to a better priority. */ remove_action( 'wp_head', 'wp_generator' ); add_action( 'wp_head', 'wp_generator', 1 ); /* Add the theme info to the header (lets theme developers give better support). */ add_action( 'wp_head', 'hybrid_meta_template', 1 );
You’ll notice the removal of a wp_generator
and then a new action hook with priority. No wonder my previous attempts didn’t work — they were running at default priority. To counter Hybrid’s addition, I simply applied a matching priority to my removal too, among other things:
function convergence_remove_header_meta() { remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wp_generator', 1); remove_action('wp_head', 'hybrid_meta_template', 1); }