Disable RSS feeds on your WordPress site

RSS, which stands for Really Simple Syndication or Rich Site Summary, is a free service that creates concise summaries of website content. 

This service benefits users in following the content of websites more easily, and enables them to view the latest content published by these sites in real time, especially in sites that publish new content on an ongoing basis, such as news sites and educational blogs. 

This service is enabled automatically on WordPress sites. But some website owners may want to disable the RSS feed feature for their sites for several reasons. In today’s article, we will explain how to disable this service on your WordPress site, and show several ways to do this using plugins or manually through code. 

Why do you need to disable RSS feeds on your WordPress site?

By default, WordPress creates all types of RSS feeds for site articles, comments, categories, tags, etc. For example, if you go to one of the following links on our site 

 

You will see dedicated RSS feeds for both home page posts and category-specific articles (explanations for beginners). But they will appear in their simple programmatic form. These feeds are files written in XML and are useful in informing users of the latest posts and all other new content on the site as it is published. 

Feeds are not usually viewed in this way, but are read and viewed more comprehensibly through dedicated readers called RSS readers. If you would like to see a detailed explanation of the RSS service, how it works, and how to read it and benefit from its content, you can see our following article , which explains in detail the concept of RSS and how to use it for your WordPress site.

But although RSS is useful in helping users see the latest content on your website. However, its popularity has decreased recently due to users relying more on following the latest developments in website content through the social media platforms attached to these sites.

Recently, most websites have social media accounts on Facebook, Twitter, Instagram, or other means of communication in order to keep their followers informed of every new content published on the site. Therefore, as a website owner, you may prefer to cancel the RSS service and rely on social media platforms instead. 

Also, if you have a one-page website with specific information, or any website that displays static content and does not include a blogging section, and does not publish articles on a regular basis, you may want to disable the RSS feeds for your site. 

Another reason to disable RSS feeds is that by default WordPress displays your full articles in RSS feed readers. This means that users who read your posts in RSS readers may stop visiting your website, which negatively affects your site traffic. 

Of course, you can change this default setting by going to your site’s control panel: Settings > Reading , and from the Reading Settings page, select the ( Excerpt ) option instead of the ( Full Text ) option next to the (Each article in the feed should be included) section, as shown in the following image. , and save the changes you made:

If you want to disable RSS feeds on your WordPress site for any of the above reasons, you can do so through the methods that we will explain in the following paragraphs.


Ways to disable RSS feeds on a WordPress site

Below we will show you two different ways to disable RSS feeds on your WordPress site. Choose the method that suits you. 

Method 1: Disable RSS feeds through plugins.
Second method: Disable RSS feeds through code. 

First – disable RSS through the Clearfy add-on

RSS feeds on a WordPress site can be easily disabled through plugins. In today’s article, we will use the  Clearfy plugin , which is a distinctive plugin that helps you improve your site’s overall performance, enables you to disable all unwanted features in WordPress, and provides many other improvement options. 

This plugin has a rating of 4.7 out of 5. It has over 100,000 active installations and is available in both free and paid versions. In today’s article we will use the free version of it in order to disable RSS feeds from our website.

The first thing you need to do is install the plugin on your WordPress site. To do this, go to your WordPress dashboard: Plugins > Add New

 Then search for the name of the Clearfy add-on in the search box, and when the add-on appears, click on the ( Install Now ) button next to the add-on name as shown in the following image.

After installing the add-on, activate it . An automatic wizard for setting up the add-on will appear, as shown in the following image. 

Since we will not go over all the plugin settings in today’s article, we will not use the previous setup wizard, so click on the Not Now link at the bottom, then go to your site’s control panel, and go to: Settings > Clearfy

Then choose the ADVANCED tab , and scroll down until you reach the Other section , as in the following image

– From Section 1, disable RSS feeds by clicking the On key next to Disable RSS Feeds. 
From Section 2, choose to direct requests for RSS pages to the 404 error page or the 301 error page. This will display one of these two pages instead of any link to display RSS feeds.


Second: Disabling RSS feeds through code

If you do not want to use plugins, you can disable RSS feeds for your WordPress site by modifying the code in the Functions.php file for the template used on your site. 

Note:  It is preferable that you create a child template from your primary template  and modify the Functions.php file for the child template, so that you do not lose the updates you make to the template if you update it.
Of course, do not forget the importance of taking a backup copy of the Functions.php file before modifying it. 

Then, from your WordPress control panel, go to: Appearance > Template Editor

A warning may appear warning you if you are making direct modifications to your template. Ignore it by clicking the ( I understand ) button.

Then the template files will appear to you on the left of the window, as shown in the following image. Select the template properties file ( functions.php ) 

Now add the following code to the end of the file, then click on the Update File button at the bottom

/**
* Redirect to the homepage all users trying to access feeds.
*/
function disable_feeds() {
wp_redirect( home_url() );
the;
}
// Disable global RSS, RDF & Atom feeds.
add_action( ‘do_feed’, ‘disable_feeds’, -1 );
add_action( ‘do_feed_rdf’, ‘disable_feeds’, -1 );
add_action( ‘do_feed_rss’, ‘disable_feeds’, -1 );
add_action( ‘do_feed_rss2’, ‘disable_feeds’, -1 );
add_action( ‘do_feed_atom’, ‘disable_feeds’, -1 );
// Disable comment feeds.
add_action( ‘do_feed_rss2_comments’, ‘disable_feeds’, -1 );
add_action( ‘do_feed_atom_comments’, ‘disable_feeds’, -1 );
// Prevent feed links from being inserted in the <head> of the page.
add_action( ‘feed_links_show_posts_feed’, ‘__return_false’, -1 );
add_action( ‘feed_links_show_comments_feed’, ‘__return_false’, -1 );
remove_action( ‘wp_head’, ‘feed_links’, 2 );
remove_action( ‘wp_head’, ‘feed_links_extra’, 3 );

The task of the previous code is to direct all links to the RSS feeds of the site, for example the domain.com/feed link, to the home page of your site. It also removes all the RSS links that WordPress usually adds in the HTML code of your site’s header.

Thus, we have reached the end of today’s article in which we learned how to disable the RSS feeds feature of your WordPress site in a simple and effective way through ready-made plugins or manually through code.  

In the end, we would like to remind you, dear reader, that if you want to turn off RSS feeds on your site, and you want your visitors to follow everything new on your site and be informed of it, then you must have another plan to share your content with visitors, such as creating newsletters (newsletter) or Posting on social media.

Avatar photo
I am a young man who has been working in WordPress and e-marketing for 10 years. I would like to share my experience with you so that we can become professional in WordPress I will be happy to share the experience with you.