RSS Feeds, while useful for content tracking, aren’t universally necessary. Disabling them can enhance website performance and prevent unauthorized content scraping. This guide will walk you through the process of disabling RSS Feeds in WordPress and removing them from Google Index.
Why Disable RSS Feeds?
- Reduce server load
- Prevent automated content scraping
- Optimize Google’s crawl budget
Improve SEO by Removing WordPress RSS Feed from Google Index
Method 1: Disabling RSS Feed Using Code
To effectively disable RSS Feeds, add the following code to your theme’s functions.php
file:
function disable_feed() { wp_die( __( 'RSS Feed is not available, please visit our homepage.' ) ); } add_action('do_feed', 'disable_feed', 1); add_action('do_feed_rdf', 'disable_feed', 1); add_action('do_feed_rss', 'disable_feed', 1); add_action('do_feed_rss2', 'disable_feed', 1); add_action('do_feed_atom', 'disable_feed', 1); add_action('do_feed_rss2_comments', 'disable_feed', 1); add_action('do_feed_atom_comments', 'disable_feed', 1);
Method 2: Using a Plugin to Disable RSS Feed
For those preferring a code-free solution, the free “Disable Feeds” plugin is an excellent option. This plugin:
- Disables all RSS/Atom feeds.
- Redirects feed requests to corresponding HTML pages.
- Offers customization in Settings -> Reading
To install, log in to the admin page, click on Plugins->Install New->Upload the plugin or search for the keyword Disable Feeds in the input box “Search for expansion packs…”.
You can then configure the plugin settings in Settings -> Reading. By default, the plugin will redirect feed requests to their corresponding HTML content. For example, if a visitor accesses a category’s RSS feed, they will be redirected to the category archive page. You can also choose to show 404 errors instead of redirecting, and decide whether to disable the global post feed and the global comment feed.
You can also use the Perfmatters plugin, which allows you to both disable and remove RSS feeds from WordPress and Google Index, along with providing other optimization functions for your WordPress site.
Remove RSS Feed from Google search console
To prevent Google from crawling unnecessary RSS Feed links:
- Check Google Search Console -> Pages -> Page Indexing -> Crawled – not indexed.
- Add the following code to your
functions.php
file:
remove_action( 'wp_head', 'feed_links', 2 ); remove_action( 'wp_head', 'feed_links_extra', 3 );
SEO Optimization After Disabling RSS Feed
- Update your sitemap.
- Submit removal requests for RSS Feed URLs in Google Search Console.
- Monitor crawl stats to ensure Google no longer crawls RSS Feed links.
By disabling RSS Feeds and removing them from the Google Index, you can improve your website’s performance and focus resources on more critical content.
Implementing these steps will help streamline your WordPress site, potentially improving its SEO performance and overall user experience. Remember to always test changes in a staging environment before applying them to your live site.