Disable RSS Feed

You need to define the HTTP Response code in wp_die function.

wp_die( __('No feed available'), '', 404 );

Also set custom header to get HTML page instead of xml page. So the code should be like below.

function itsme_disable_feed() {
 global $wp_query;
 $wp_query->is_feed = false;
 $wp_query->set_404();
 status_header( 404 );
 nocache_headers();
 wp_die( __('No feed available'), '', 404 );
}

Leave a Comment