How to Disable RSS Feeds, Disabled unwanted WordPress Feeds

 In RSS Feeds

Does your website have only static content? Don’t want the RSS Feeds to be created and published? With this code, you can disable all types of feeds.

Introduction to Feeds

“A feed is a function of special software that allows feedreaders to access a site, automatically looking for new content and then posting the information about new content and updates to another site. This provides a way for users to keep up with the latest and hottest information posted on different blogging sites.
There are several different kinds of feeds, read by different feedreaders. Some feeds include RSS (alternately defined as “Rich Site Summary” or “Really Simple Syndication”), Atom or RDF files.”

Source : https://codex.wordpress.org/WordPress_Feeds

How to Disable RSS Feeds, Disabled unwanted WordPress Feeds – please add the code snippet below on your WordPress theme’s functions.php file.

function ns_disable_feed() {
 wp_die( __(‘No feed available, Please visit our <a href="">homepage</a> to see our site!’) );
}

add_action(‘do_feed’, ‘ns_disable_feed’, 1);
add_action(‘do_feed_rdf’, ‘ns_disable_feed’, 1);
add_action(‘do_feed_rss’, ‘ns_disable_feed’, 1);
add_action(‘do_feed_rss2′, ‘ns_disable_feed’, 1);
add_action(‘do_feed_atom’, ‘ns_disable_feed’, 1);

Thank you for seeing my tutorial and fell free to share and comment 🙂 . Do you have a code snippet and you want to see it publish on my site ? I will be more than happy to do it please send me a message (here)

Recommended Posts

Leave a Comment

Start typing and press Enter to search