Skip to content

Instantly share code, notes, and snippets.

@jpmarchand
Last active January 29, 2017 02:42
Show Gist options
  • Save jpmarchand/1b645f9cb0a880d2f93f to your computer and use it in GitHub Desktop.
Save jpmarchand/1b645f9cb0a880d2f93f to your computer and use it in GitHub Desktop.
<?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