# Keep Feeds Out of Search Results

> Sends an X-Robots-Tag header that asks search engines not to index your RSS feeds, so feed URLs do not compete with your real pages.

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

## Code

```php
add_action( 'template_redirect', function () {
    if ( is_feed() && ! headers_sent() ) {
        header( 'X-Robots-Tag: noindex, follow', true );
    }
}, 1 );
```

## Notes

Feed readers ignore this header, so subscribers are not affected.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Keep Feeds Out of Search Results" 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/
