Posted By

chrisaiv on 09/13/14


Tagged

wordpress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tryan326


Wordpress: Remove header junk from default Wordpress install


 / Published in: PHP
 

Over the years, wordpress has placed a lot of junk in their system.

  1. /** ******** ******** ******** ******** ******** ******** ******** ********
  2. * TITLE: Remove unnecessary meta-data from your WordPress site
  3. * DESCRIPTION: Over the years, wordpress has placed a lot of junk in their system.
  4. */
  5. function remove_header_extra(){
  6. //Are you editing your WordPress blog using your browser? Then you are not using a blog client
  7. remove_action('wp_head', 'rsd_link');
  8. // Windows Live Writer is (it’s another blog editing client
  9. remove_action('wp_head', 'wlwmanifest_link');
  10. //This announces that you are running WordPress and what version you are using.
  11. remove_action('wp_head', 'wp_generator');
  12. //URL shortening is sometimes useful, but this automatic ugly url in your header is useless.
  13. remove_action('wp_head', 'wp_shortlink_wp_head');
  14. // Display the links to the general feeds: Post and Comment Feed
  15. remove_action('wp_head', 'feed_links', 2);
  16. //// Display the links to the extra feeds such as category feeds
  17. remove_action('wp_head', 'feed_links_extra', 3);
  18. //Deprecated
  19. remove_action('wp_head', 'index_rel_link');
  20. // start link
  21. remove_action('wp_head', 'start_post_rel_link', 10, 0);
  22. // prev link
  23. remove_action('wp_head', 'parent_post_rel_link', 10, 0);
  24. // Display relational links for the posts adjacent to the current post.
  25. remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
  26. }
  27. add_action('init', 'remove_header_extra');

Report this snippet  

You need to login to post a comment.