I’m using these filters to clean the head of my theme:
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
remove_action('wp_head', 'locale_stylesheet');
remove_action('wp_head', 'noindex');
remove_action('wp_head', 'wp_print_styles');
remove_action('wp_head', 'wp_print_head_scripts');
However, I can’t seem to get rid of these:
<link rel='prev' title='Top Menu Item 1' href='http://localhost/test/test-prev.html' />
<link rel='next' title='Internal title test default title' href='http://localhost/test/text-next.html' />
<link rel='shortlink' href='http://localhost/test/?p=528' />
One shouldn’t remove them. They are important for search engines like Google.
One can remove them like this:
Here are some additional explanations why they should not be removed and how this effects search engines:
In case one removes them, one should really add its own (in case one has changed their links and they are not pointing to the correct urls, that the pagination points to).
Add these to your list:
wp-includes/default-filters.php
should be your first stop to check out what WordPress is using its own hook system for.I’ve been struggling with this for a while, too, and it appears you should remove action with exactly the same parameters it was added.
so for me the following like in functions.php did the job:
I’m using WP 3.3.1