I want to disable feeds and things like that (rpc, pingbacks, wlwmanifest, prev/next). Reason is that the website is not a blog, so these are of no use.
I wrote the following in a plugin:
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'wlwmanifest_link');
// and so on...
Indeed the links are no longer in the header. But if I request any of the corresponding url, they still work. I've just removed the links, not the functionality.
I found a hint on wpengineer, and added the following to my plugin:
function fb_disable_feed() {
wp_die( __('No feed available!') );
}
add_action('do_feed', 'fb_disable_feed', 1);
add_action('do_feed_rdf', 'fb_disable_feed', 1);
add_action('do_feed_rss', 'fb_disable_feed', 1);
add_action('do_feed_rss2', 'fb_disable_feed', 1);
add_action('do_feed_atom', 'fb_disable_feed', 1);
Doesn't seem to work (although I've seen many references to such code).
Any idea on how I could remove all these feeds, rpc and so on? Or at least have them return something like "Nothing here"?
Notes:
I don't want to edit core wp files of course!
I think the admin area uses feeds. I'm fine with it, I just want them removed from the front end.
do_feed*
to disable feeds works, as it does not work for me.