# Any RSS Feed as a Dashboard Widget

> Shows the latest headlines from an RSS feed of your choice on the dashboard, such as your agency blog or an industry news site.

- Type: PHP
- Runs: Admin only
- Category: [Dashboard](https://wpide.com/library/category/dashboard/)
- Tags: dashboard, widget, rss
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/rss-feed-dashboard-widget/

## Code

```php
$wpide_feed_widget = array(
    'title' => 'Latest News',
    'url'   => 'https://wordpress.org/news/feed/',
    'items' => 5,
);

add_action( 'wp_dashboard_setup', function () use ( $wpide_feed_widget ) {
    wp_add_dashboard_widget( 'wpide_rss_feed', esc_html( $wpide_feed_widget['title'] ), function () use ( $wpide_feed_widget ) {
        echo '<div class="rss-widget">';
        // wp_widget_rss_output() fetches the feed and caches it for 12 hours.
        wp_widget_rss_output( $wpide_feed_widget['url'], array(
            'items'        => (int) $wpide_feed_widget['items'],
            'show_summary' => 1,
            'show_date'    => 1,
        ) );
        echo '</div>';
    } );
} );
```

## Notes

The feed is fetched from the remote site, then cached by WordPress.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Any RSS Feed as a Dashboard Widget" 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/
