Skip to main content Skip to secondary navigation Accessibility Feedback

Remove junk from the WordPress header

If you ever view the source of your WordPress blog, you’ll notice that WordPress adds a bunch of unnecessary junk into the header.

It includes:

  • A Really Simply Discovery link so other services – Flickr, for example – can easily publish to your blog.
  • A Windows Live Writer link, which is only useful if you use Windows Live Writer.
  • The version of WordPress you’re using, which matters to no one.
  • Links to the next and previous posts, as well as a random older post, all uselessly hidden in the header.

Removing this junk is as simple as adding a few lines of code to your functions.php file. Here’s the code, courtesy of Theme Lab…

remove_action('wp_head', 'rsd_link'); // Removes the Really Simple Discovery link
remove_action('wp_head', 'wlwmanifest_link'); // Removes the Windows Live Writer link
remove_action('wp_head', 'wp_generator'); // Removes the WordPress version
remove_action('wp_head', 'start_post_rel_link'); // Removes the random post link
remove_action('wp_head', 'index_rel_link'); // Removes the index page link
remove_action('wp_head', 'adjacent_posts_rel_link'); // Removes the next and previous post links
  • More articles on...
  • Code

Have any questions or comments about this post? Email me at chris@gomakethings.com or contact me on Twitter at @ChrisFerdinandi.

Get the Weekly Digest