Remove some unneeded WordPress code

BP Design LLC

If you ever view the source of your WordPress site, you’ll notice that WordPress adds a bunch of unnecessary links 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 useful if you use Windows Live Writer.
The version of WordPress you’re using.
Links to the next and previous posts, as well as a random older post.

Removing these 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

1 Comment

  • Mr WordPress says:

    Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.

Leave a Reply

Your email address will not be published. Required fields are marked *