Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
//* 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="https://twitter.com/account-name/" 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.