Remove the auto-discovery RSS and Atom feed link tags that WordPress outputs in every page head, along with the comment feed links.
add_action( 'init', function() {
// Remove post and post comment feed links
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
} );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
WordPress automatically adds several <link> tags to the <head> of every page that advertise the existence and location of your site’s RSS and Atom feeds. These auto-discovery links allow RSS readers and feed aggregators to find your feeds without you having to submit them manually. While that was valuable in the Google Reader era, feed consumption has declined significantly, and for many modern sites these tags are unused noise that marginally increase head payload.
More practically, many site owners simply don’t use or maintain their RSS feeds. Disabling the links while the feeds themselves remain accessible is a clean middle ground, you’re not breaking anything for users who know your feed URL, just stopping WordPress from advertising it on every page.
Two remove_action calls on the init hook handle both sets of feed links that WordPress outputs.
feed_links at priority 2 outputs the main site-level feeds, the primary RSS2 feed and the Atom feed for all posts. These are the /feed/ and /feed/atom/ URLs.
feed_links_extra at priority 3 outputs additional contextual feed links that change based on the current page. On a category archive it outputs the category feed link. On a tag archive it outputs the tag feed. On an author archive it outputs the author feed. On a single post it outputs the post’s comment feed. Removing this stops all of these contextual auto-discovery links from being output.
Removing these link tags does not disable the actual RSS feeds. The /feed/ URL still works and returns valid RSS XML. Users and services that already know your feed URL are unaffected. Only the auto-discovery mechanism, the link tags that tell software where to look, is removed. If you want to disable the feeds entirely and return a 404 for feed requests, that’s a separate step requiring a redirect rule or a more aggressive hook.
Keep feed links if your site has an active newsletter subscription workflow that integrates with your RSS feed, services like Mailchimp’s RSS-to-email campaigns use feed auto-discovery. Keep them if your content is aggregated by feed readers that your audience actively uses. For a business site, portfolio, or e-commerce store where blogging is secondary, removing them is an easy, zero-risk cleanup.
RSS feed links have no relationship to XML sitemaps or Google Search Console. Removing them has no effect on crawling, indexing, or how Google discovers your content. If you’re concerned about search engine coverage, your XML sitemap, not your RSS feed auto-discovery links, is the correct mechanism for communicating content to Google.