# Remove Comment Feeds

> Removes comment feed links from the page head and redirects comment feed URLs to the homepage, while keeping the post feeds.

- Type: PHP
- Runs: Run everywhere
- Category: [RSS Feeds](https://wpide.com/library/category/rss/)
- Tags: rss, feeds, comments
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/remove-comment-feeds/

## Code

```php
add_filter( 'feed_links_show_comments_feed', '__return_false' );
add_filter( 'feed_links_extra_show_post_comments_feed', '__return_false' );

add_action( 'template_redirect', function () {
    if ( is_comment_feed() ) {
        wp_safe_redirect( home_url( '/' ), 301 );
        exit;
    }
}, 1 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remove Comment 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/
