We may need to get the WordPress blog RSS feed on some other pages out of WordPress. Let's see how to achieve this.

First, we need WordPress blog RSS feed URL. Generally, the URL is http://example.com/feed or


Now move to the second step. We simply load the RSS XML by using function - simplexml_load_file()

This will fetch the XML feed from WordPress. $blog_rss->channel->item will contain all the posts, to show them, we can use foreach() loop to display posts on the desired page.

Copy the below code snippets and paste it to the desired page, then simply replace the feed URL with your WordPress feed URL.

$feed_url='https://example.com/feed'; // feed URL
$blog_rss = simplexml_load_file($feed_url); // Fetch the RSS XML

<div class='blogFeed'>
    <?php foreach ($blog_rss->channel->item as $item): ?>
        <div class='feedPost'>
            <div class='heading'><a href="<?=$item->link?>"><?=$item->title?></a></div>
            <span class='badge'><?=$item->pubDate?></span>
    <?php endforeach; ?>

$blog_rss->channel->title : This is the channel title, like your site title.

$blog_rss->channel->item : This contains the posts

$item->link : This is the URL of the post

$item->pubDate : This is the published date of post

$item->description : This is the description or excerpt of the post

That is all.