Clean up WordPress header without plugin
Do you want to remove unnecessary code from your wordpress blog header?
When you look at your WordPress website you may have noticed a lot of source code in your <head> tag whether you want it or not such as rel=” pingback”, re=” alternative”, and WordPress version.
However, if you are a clean WP head tag, it improves your website speed and looks like WordPress code nice.
So you’ll require to add some remove_action functions in the function.php file to clean up your WordPress head tag.
What are advantages?
- Increase performance on your WordPress site.
- Content to Code ratio increase
- Improve search engine reads
Overview of the full WordPress <head> Code
Add below source code to your theme’s functions.php file:
Give here some code of what is added to your WordPress. //Remove the generator remove_action( 'wp_head', 'wp_generator' ); //Remove RSD Link remove_action( 'wp_head', 'rsd_link' ); //Remove REST API link tag remove_action( 'wp_head', 'rest_output_link_wp_head', 10 ); //Remove oEmbed links remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 ); //Remove REST API in HTTP Headers remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 ); //Remove WLW Manifest remove_action( 'wp_head', 'wlwmanifest_link' ); //Remove the short link remove_action( 'wp_head', 'wp_shortlink_wp_head' );
Enjoy and have fun.
Now clean up your WordPress head tag.