RSS Feed deaktivieren

// Disable Feed
function wpte_disable_all_feeds() {
    // Disable RSS and Atom feeds
    add_action('do_feed', 'wpte_disable_all_feeds_action', 1);
    add_action('do_feed_rdf', 'wpte_disable_all_feeds_action', 1);
    add_action('do_feed_rss', 'wpte_disable_all_feeds_action', 1);
    add_action('do_feed_rss2', 'wpte_disable_all_feeds_action', 1);
    add_action('do_feed_atom', 'wpte_disable_all_feeds_action', 1);
    // Disable XMLRPC
    add_filter('xmlrpc_enabled', '__return_false');
    // Remove feed links from the head
    remove_action('wp_head', 'feed_links', 2);
    remove_action('wp_head', 'feed_links_extra', 3);
}
function wpr_disable_all_feeds_action() {
    wp_die('Kein Feed verfügbar - bitte besuche unsere Homepage.');
}
add_action('init', 'wpte_disable_all_feeds');
Posted in

Hinterlassen Sie einen Kommentar