Created
October 12, 2023 16:48
-
-
Save bobbydank/41db5cc4bc2f28ac4bc8eb35b2bb3aee to your computer and use it in GitHub Desktop.
removes rss feeds from wordpress
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 cl_itsme_disable_feed() { | |
wp_die( __( 'No feed available, please visit the <a href="'. esc_url( home_url( '/' ) ) .'">homepage</a>!' ) ); | |
} | |
add_action('do_feed', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_rdf', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_rss', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_rss2', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_atom', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_rss2_comments', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_atom_comments', 'cl_itsme_disable_feed', 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment