Last active
February 15, 2024 16:05
-
-
Save khoipro/72761b70925fbee3d52f41a3d572fede to your computer and use it in GitHub Desktop.
Remove Unnecessary Code in WordPress Header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove Meta Generator: <meta name="generator" content="WordPress x.x" /> | |
// and <meta name="generator" content="WooCommerce x.x.x" /> | |
remove_action('wp_head', 'wp_generator'); | |
// Remove the EditURI/RSD | |
// Like: <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost/wp/xmlrpc.php?rsd" /> | |
remove_action ('wp_head', 'rsd_link'); | |
// Remove it if you don't know what is Windows Live Writer | |
// <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost/wp/wp-includes/wlwmanifest.xml" /> | |
remove_action( 'wp_head', 'wlwmanifest_link'); | |
// Remove page/post's short links | |
// Like: <link rel='shortlink' href='http://localhost/wp/?p=5' /> | |
remove_action( 'wp_head', 'wp_shortlink_wp_head'); | |
// Remove feed links | |
// Like: <link rel="alternate" type="application/rss+xml" title="WP Site » Feed" href="http://localhost/wp/feed/" /> | |
remove_action( 'wp_head', 'feed_links', 2 ); | |
// Remove comment feeds | |
// Like: <link rel="alternate" type="application/rss+xml" title="WP Site » Comments Feed" href="http://localhost/wp/comments/feed/" /> | |
remove_action('wp_head', 'feed_links_extra', 3 ); | |
// Remove PREV and NEXT links | |
// Like: <link rel='prev' title='The Post Before This One' href='http://localhost/wp/?p=4' /> | |
remove_action('wp_head', 'adjacent_posts_rel_link'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also use: