# Disable RSS Feeds

> Redirects every feed URL to the homepage and removes feed links from the page head. Useful for brochure sites and web apps that do not publish posts.

- Type: PHP
- Runs: Run everywhere
- Category: [Disable Features](https://wpide.com/library/category/disable-features/)
- Tags: rss, feeds, disable
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/disable-rss-feeds/

## Code

```php
$wpide_feed_redirect = 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 $wpide_feed_hook ) {
    add_action( $wpide_feed_hook, $wpide_feed_redirect, 1 );
}

remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Disable RSS Feeds" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
