How to remove metags from WP header

 In Themes

Like my style, If you really want to remove those annoying meta tags to clean up the header & for security reasons, then place the below codes.

 

// remove unnecessary meta tags
function metaremovetpk() {
remove_action(‘wp_head’, ‘wp_generator’);
remove_action(‘wp_head’, ‘rsd_link’);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link’);
remove_action(‘wp_head’, ‘wlwmanifest_link’);
remove_action(‘wp_head’, ‘index_rel_link’);
remove_action(‘wp_head’, ‘start_post_rel_link’);
}
add_action(‘init’, ‘metaremovetpk’);
Recommended Posts

Start typing and press Enter to search