Last active
October 7, 2021 14:01
-
-
Save itsHall/2b5a8edc83ca53d4920b66ba4c94321d to your computer and use it in GitHub Desktop.
Disable RSS Feed and Show Message
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 | |
function itsme_disable_feed() { | |
wp_die( __( 'No feed available, please visit the <a href="'. esc_url( home_url( '/' ) ) .'">homepage</a>!' ) ); | |
} | |
add_action('do_feed', 'itsme_disable_feed', 1); | |
add_action('do_feed_rdf', 'itsme_disable_feed', 1); | |
add_action('do_feed_rss', 'itsme_disable_feed', 1); | |
add_action('do_feed_rss2', 'itsme_disable_feed', 1); | |
add_action('do_feed_atom', 'itsme_disable_feed', 1); | |
add_action('do_feed_rss2_comments', 'itsme_disable_feed', 1); | |
add_action('do_feed_atom_comments', 'itsme_disable_feed', 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment