Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
//* Disable RSS feeds in WordPress
add_action('do_feed', 'customprefix_disable_rss_feeds', 1);
add_action('do_feed_rdf', 'customprefix_disable_rss_feeds', 1);
add_action('do_feed_rss', 'customprefix_disable_rss_feeds', 1);
add_action('do_feed_rss2', 'customprefix_disable_rss_feeds', 1);
add_action('do_feed_atom', 'customprefix_disable_rss_feeds', 1);
add_action('do_feed_rss2_comments', 'customprefix_disable_rss_feeds', 1);
add_action('do_feed_atom_comments', 'customprefix_disable_rss_feeds', 1);
function customprefix_disable_rss_feeds() {
wp_die(__('Sorry, but syndication has been disabled on this site. To be notified of a new post, please follow us on <a href="" target="_blank" rel="nofollow">Twitter</a>.<br/><br/>Back to <a href="' . get_bloginfo('url') . '">homepage</a>.'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.