Skip to content

Instantly share code, notes, and snippets.

@bewho
Forked from johnnyicarus/gist:9643945
Created January 21, 2019 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bewho/370f2e1bf2fb84e8bddfd49899b77fd1 to your computer and use it in GitHub Desktop.
Save bewho/370f2e1bf2fb84e8bddfd49899b77fd1 to your computer and use it in GitHub Desktop.
Remove WPML Generator Tag
/**
* Remove <meta name="generator"> tag created by the WPML PLugin.
* Wrapped in an if-statement that checks for an instance of the
* sitepress-class (made global by WPML)
*
* @url http://wordpress.stackexchange.com/questions/117469/how-to-remove-wpml-generator-meta-tag-by-themes-functions-php-override-plugin
*
* @uses add_action
* @uses remove_action
* @uses current_filter
*/
if ( !empty ( $GLOBALS['sitepress'] ) ) {
function remove_wpml_generator() {
remove_action(
current_filter(),
array ( $GLOBALS['sitepress'], 'meta_generator_tag' )
);
}
add_action( 'wp_head', 'remove_wpml_generator', 0 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment