I would like to redirect my visitors to my 404 when they visit any feed of my page. Something like this. I would liek to do this without changing the header URL.
function fb_disable_feed() {
// set_404();
}
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);
Please help!
There are three simple steps to get what you want:
'template_redirect'
to act before the feed is displayed.Here is a simple plugin that does it:
I am not so sure that
404
is the proper status code.410
(Gone) may fit better.