# Copyright and Contact Details in Your Feeds

> Adds a copyright notice to your RSS and Atom feeds, plus optional editor and webmaster contact addresses, which feed directories and readers show alongside your feed.

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

## Code

```php
// Copyright line for the feed. {year} and {site} are replaced. Leave empty to skip it.
$wpide_feed_copyright = '© {year} {site}. All rights reserved.';
// Contact addresses shown to feed readers, as "email@example.com (Name)". Leave empty to skip them.
$wpide_feed_editor    = '';
$wpide_feed_webmaster = '';

$wpide_feed_copyright_text = function () use ( $wpide_feed_copyright ) {
    return strtr( $wpide_feed_copyright, array(
        '{year}' => wp_date( 'Y' ),
        '{site}' => get_bloginfo( 'name' ),
    ) );
};

add_action( 'rss2_head', function () use ( $wpide_feed_copyright_text, $wpide_feed_editor, $wpide_feed_webmaster ) {
    $copyright = $wpide_feed_copyright_text();

    if ( '' !== $copyright ) {
        echo "\t<copyright>" . esc_xml( $copyright ) . "</copyright>\n";
    }

    if ( '' !== $wpide_feed_editor ) {
        echo "\t<managingEditor>" . esc_xml( $wpide_feed_editor ) . "</managingEditor>\n";
    }

    if ( '' !== $wpide_feed_webmaster ) {
        echo "\t<webMaster>" . esc_xml( $wpide_feed_webmaster ) . "</webMaster>\n";
    }
} );

add_action( 'atom_head', function () use ( $wpide_feed_copyright_text ) {
    $copyright = $wpide_feed_copyright_text();

    if ( '' !== $copyright ) {
        echo "\t<rights>" . esc_xml( $copyright ) . "</rights>\n";
    }
} );
```

## Notes

{year} and {site} in the copyright text are replaced automatically; leave the email lines empty to skip them.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Copyright and Contact Details in Your 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/
