How to disable RSS feeds on your WordPress blog
Tento článek (nebo jeho část) je převzat z externího zdroje. Je tedy slušností jej uvést včetně případného autora.
WordPress built-in RSS feeds are definitely cool. But if you’re using WordPress to create a simple website, you may do not need the feeds at all. So what about disabling them? Here’s a simple and clean way to do it.
Paste the code below into your functions.php file. RSS feeds will not be available anymore after you saved the file.
1 2 3 4 5 6 7 8 |
unction digwp_disable_feed() { wp_die(__('<h1>Feed not available, please visit our <a href="'.get_bloginfo('url').'">Home Page</a>!</h1>')); } add_action('do_feed', 'digwp_disable_feed', 1); add_action('do_feed_rdf', 'digwp_disable_feed', 1); add_action('do_feed_rss', 'digwp_disable_feed', 1); add_action('do_feed_rss2', 'digwp_disable_feed', 1); add_action('do_feed_atom', 'digwp_disable_feed', 1); |
Napsat komentář