# Use Your Logo as the Feed Image

> Shows your own logo in feed readers instead of the site icon, which is often too small or too simple for that space.

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

## Code

```php
// Full URL of the logo for feeds (empty = custom logo from the theme).
$wpide_feed_logo = '';

add_action( 'init', function () {
    remove_action( 'rss2_head', 'rss2_site_icon' );
} );

add_action( 'rss2_head', function () use ( $wpide_feed_logo ) {
    $url = $wpide_feed_logo;

    if ( '' === $url && has_custom_logo() ) {
        $url = (string) wp_get_attachment_image_url( (int) get_theme_mod( 'custom_logo' ), 'medium' );
    }

    if ( '' === $url ) {
        return;
    }

    echo "<image>\n";
    echo "\t<url>" . esc_url( $url ) . "</url>\n";
    echo "\t<title>" . esc_html( get_bloginfo_rss( 'name' ) ) . "</title>\n";
    echo "\t<link>" . esc_url( home_url( '/' ) ) . "</link>\n";
    echo "</image>\n";
} );
```

## Notes

Put the full URL of a square image of at least 144 pixels in $wpide_feed_logo, or leave it empty to use the theme's custom logo.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Use Your Logo as the Feed Image" 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/
