-
-
Save jpmarchand/1b645f9cb0a880d2f93f to your computer and use it in GitHub Desktop.
Disable RSS feeds in WordPress. Source: http://www.wpbeginner.com/wp-tutorials/how-to-disable-rss-feeds-in-wordpress/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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