Last active
November 6, 2015 12:05
-
-
Save rickrduncan/b7f95d0c40a763c8081c to your computer and use it in GitHub Desktop.
Small script to place in child theme functions.php file to disable RSS feed.
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 | |
//* Do NOT include the opening php tag | |
//* BEGIN: Disable WordPress RSS Feed | |
function b3m_disable_rss_feed() { | |
wp_die( __( 'Our RSS feed is disabled. Please <a href="'. get_bloginfo('url') .'">visit our homepage</a>.' ) ); | |
} | |
add_action( 'do_feed', 'b3m_disable_rss_feed', 1 ); | |
add_action( 'do_feed_atom', 'b3m_disable_rss_feed', 1 ); | |
add_action( 'do_feed_rdf', 'b3m_disable_rss_feed', 1 ); | |
add_action( 'do_feed_rss', 'b3m_disable_rss_feed', 1 ); | |
add_action( 'do_feed_rss2', 'b3m_disable_rss_feed', 1 ); | |
//* END: Disable WordPress RSS Feed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment