Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Turn off RSS feeds

Every feed address (/feed/, comment feeds, category feeds) sends visitors to the home page, and the feed links leave the page head.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Tested with WordPress 7.1
PHP
<?php

$no_feed = static function () {
	wp_safe_redirect( home_url( '/' ), 301 );
	exit;
};
foreach ( array( 'do_feed', 'do_feed_rdf', 'do_feed_rss', 'do_feed_rss2', 'do_feed_atom', 'do_feed_rss2_comments', 'do_feed_atom_comments' ) as $feed ) {
	add_action( $feed, $no_feed, 1 );
}
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );

Good to know

Podcasts, newsletter tools and feed readers use your feed. Leave this off if you use any of them.

In these packs

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.