How To Disable RSS Feed URLs in WordPress Website Tutorial

Reading Time: 6 minutes
457 Views

Inside this article we will see the concept i.e How To Disable RSS Feed URLs in WordPress Website. Article contains the classified information i.e What is an RSS Feed & How To Stop WordPress from Generating RSS feeds.

RSS (Really Simple Syndication) feed is a format for publishing frequently updated content such as blog posts, news articles, podcasts, and videos. In WordPress, RSS feeds are automatically generated.

Read More: Laravel 10 Concept of Route Model Binding with Example

Let’s get started.

What is an RSS Feed?

RSS feeds usually include a list of the most recent posts or articles from a website, as well as a summary or excerpt for each item. An RSS reader, which can be a standalone application or a web-based service, allows users to subscribe to RSS feeds.

Once subscribed, the reader checks the RSS feed for updates on a regular basis and notifies the user when new content is available.

RSS feeds are frequently used by blogs, news websites, and other websites that publish frequently updated content. They make it simple for users to stay up to date on new content without having to visit each site individually.

Furthermore, RSS feeds can be aggregated by other websites or services, allowing the content to be distributed even further.

Read More: How To Create Custom Facade in Laravel 10 Tutorial

How To Disable RSS Feed URLS in WordPress?

In WordPress, there are multiple ways to Disable an RSS Feed.

We will see two methods:

  • By Using a WordPress Plugin
  • By Adding Custom Code into Theme’s functions.php

Let’s see in action.

Method #1: By Using a WordPress Plugin

Open your WordPress admin panel. Go to Plugins >> Add New.

Search for “disable everything

Click on Install Now and install it in your wordpress site.

Once, it will be installed. Then click on Activate button.

Next,

If it activates successfully, then you should see a Settings link with plugin.

Click on Settings link.

Or you can find the Settings of this plugin inside Settings Menu of WordPress.

Click on Disable Everything link.

You will then find a RSS Feed row inside it’s settings layout.

Simply, you need to check this checkbox and Save to disable.

Read More: How To Use Trait in Laravel 10 Example Tutorial

Method #2: By Adding Custom Code into Theme’s functions.php

The second alternative way here is to Add Custom Code into functions.php of your activated theme.

This method is not recommended for those who don’t know about a bit about working code and use of Core files. But if you know the working of functions.php and all files then you can do this but in a very careful way.

Here, is the code you need to just Copy and Paste inside your functions.php file of activated theme. You can add at footer of this file.

// Remove feed URLs from the header
function disable_feed_links()
{
	remove_action('wp_head', 'feed_links', 2);
	remove_action('wp_head', 'feed_links_extra', 3);
}
add_action('init', 'disable_feed_links');
// Redirect feed requests to the original page
function redirect_feed_requests_to_original_page($query)
{
	if ($query->is_feed) {
		global $wp;
		$current_url = home_url(add_query_arg(array(), $wp->request));
		$original_url = preg_replace('/\/feed(\/.*|$)/', '', $current_url);
		wp_redirect($original_url, 301);
		exit;
	}
}
add_action('parse_query', 'redirect_feed_requests_to_original_page');

We hope this article helped you to learn about How To Disable RSS Feed URLs in WordPress Website Tutorial in a very detailed way.

Read More: How To Work with Route Middleware in Laravel 10 Tutorial

Online Web Tutor invites you to try Skillshike! Learn CakePHP, Laravel, CodeIgniter, Node Js, MySQL, Authentication, RESTful Web Services, etc into a depth level. Master the Coding Skills to Become an Expert in PHP Web Development. So, Search your favourite course and enroll now.

If you liked this article, then please subscribe to our YouTube Channel for PHP & it’s framework, WordPress, Node Js video tutorials. You can also find us on Twitter and Facebook.

Sanjay KumarHello friends, I am Sanjay Kumar a Web Developer by profession. Additionally I'm also a Blogger, Youtuber by Passion. I founded Online Web Tutor and Skillshike platforms. By using these platforms I am sharing the valuable knowledge of Programming, Tips and Tricks, Programming Standards and more what I have with you all. Read more