Skip to content

Instantly share code, notes, and snippets.

@QROkes
Last active September 14, 2015 05:47
Show Gist options
  • Save QROkes/30e56efac23340edda5e to your computer and use it in GitHub Desktop.
Save QROkes/30e56efac23340edda5e to your computer and use it in GitHub Desktop.
Remove WordPress generator meta tag
// Remove WordPress Generator Meta Tag
function remove_generator_filter() { return ''; }
if (function_exists('add_filter')) {
$types = array('html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export');
foreach ($types as $type)
add_filter('get_the_generator_'.$type, 'remove_generator_filter');
}
// Another option:
function qr_remove_wp_version() {return '';}
add_filter('the_generator', 'qr_remove_wp_version');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment