Skip to content

Instantly share code, notes, and snippets.

@arifhazwan
Created January 23, 2019 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arifhazwan/fc579bec45623a249e507da73442ccf0 to your computer and use it in GitHub Desktop.
Save arifhazwan/fc579bec45623a249e507da73442ccf0 to your computer and use it in GitHub Desktop.
Wordpress Disable Feed
function wpfeed_disable() {
wp_die( __( 'Not available, check out <a href="'. esc_url( 'https://www.facebook.com/' ) .'">Facebook</a>!' ) );
}
add_action('do_feed', 'wpfeed_disable', 1);
add_action('do_feed_rdf', 'wpfeed_disable', 1);
add_action('do_feed_rss', 'wpfeed_disable', 1);
add_action('do_feed_rss2', 'wpfeed_disable', 1);
add_action('do_feed_atom', 'wpfeed_disable', 1);
add_action('do_feed_rss2_comments', 'wpfeed_disable', 1);
add_action('do_feed_atom_comments', 'wpfeed_disable', 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment