How to block your rss feed in wordpress website

How to block your rss feed in wordpress website

In that situation you need to use following techniques. We given tricks, techniques and code for block your rss feed in wordpress website. Many people does not want to show their websites need to be cached or indexed by search engine. In that situation you need to use following techniques.

How to block your rss feed in wordpress website

How to block your rss feed in wordpress website
How to block your rss feed in wordpress website

First create the robots.txt file and put following code in that file.

User-agent: *

Disallow: /

You need to open functions.php file for disabling the rss feed from your website.
Put following code in that file.

function disable_rss_feed() {
    wp_die( __('No Rss feed are available,please visit our <a href="'. get_bloginfo('url') .'">website</a>!') );
}

add_action('do_feed', 'disable_rss_feed', 1);
add_action('do_feed_rdf', 'disable_rss_feed', 1);
add_action('do_feed_rss', 'disable_rss_feed', 1);
add_action('do_feed_rss2', 'disable_rss_feed', 1);
add_action('do_feed_atom', 'disable_rss_feed', 1);

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

2 thoughts on “How to block your rss feed in wordpress website”

Leave a Reply

Your email address will not be published.