Resources     Blog  

  1. Home
  2. WordPress Tutorials
  3. How to Add an External RSS Feed in WordPress

How to Add an External RSS Feed in WordPress

Are you looking to add an external RSS feed in WordPress? RSS feeds have lost popularity over the years as social media platforms like Facebook and Twitter have taken over, but they still have followers. While you may not have an RSS feed of your own, there are plenty of external RSS feeds that you can add to your website.

There are thousands of RSS feeds on the Internet and you can add any of them to your website, but try to make sure that you have permission. The best way to add an RSS feed in WordPress is to embed it. Today, I will demonstrate how to add an external RSS feed in WordPress using some simple code.

Why Add an RSS Feed in WordPress

Before the rise of social media platforms, RSS feeds were one of the best ways to share your content between multiple websites. For example, if you run two or three websites, you could add an RSS feed from website A to website B and C to help share your content with visitors. However, since social media has become so prominent most content sharing occurs on platforms like Facebook.

While sharing content may not be the best use of RSS feeds, it still has other uses. For example, let’s say you have a website that writes stock reviews and predictions. You could add an RSS feed that tracks stock or cryptocurrency prices. There are feeds for almost anything and many of them may be a good match for your website. Just be sure to give credit to the appropriate sources.

How to Add an External RSS Feed in WordPress

Today, I will demonstrate how to add an external RSS feed in WordPress using some simple code. The easiest way is to embed RSS feeds in WordPress, but unlike videos, WordPress does not have a built-in RSS embedder. Instead, we will need to add a few lines of code to the functions.php file. Then we can use a shortcode to embed an RSS feed in WordPress.

Since you will be editing files on the backend of your website, it is a good idea to create a backup of your website. While it is easy to add this code, it is still possible to make a mistake. You can use the backup to revert your website to before the mistake was made.

Adding the Code

Let’s start by logging into the cPanel and clicking on the File Manager option. The File Manager will allow you to access all of the files related to your website.

Click on the File Manager option.

You need to locate your theme’s functions.php file. Click on the public_html directory, then click on the wp-content folder. Inside of this folder, you will find all of the content related to your website. Click on the themes folder and enter the folder of the theme you are currently using. Finally, right-click on the functions.php file and select the Edit option.

Select the "Edit" option.

A pop-up window will show up. This box will warn you to create a backup of your files before editing anything. This will ensure that you can revert your website back to when it was working if something goes wrong. Click on the “Edit” button. A new tab will open containing all of the code from the file.

Click on the "Edit" button.

Copy and paste the following code into your functions.php file:

//This file is needed for the wp_rss() function.
include_once(ABSPATH.WPINC.’/rss.php’);
//This function is used to use external RSS feeds in WordPress.
function Add_Rss($atts) {
extract(shortcode_atts(array(
“feed” => ‘http://’,
“num” => ‘1’,
), $atts));

return wp_rss($feed, $num);
}

add_shortcode(‘rss’, ‘Add_Rss’);

Once you have inserted the code into the functions.php file, click on the “Save Changes” button to finish.

Click on the "Save Changes" button.

Adding the RSS Feed in WordPress

Now that the code is in place you are ready to start adding RSS Feeds to your website. All you need to do is use the following shortcode on your website:

[rss feed=”https://www.YourFeedHere.com” num=”1″]

Congratulations you have successfully added an external RSS feed in WordPress. You can add as many feeds as you want, but make sure they belong on your website.

More Content With Little Effort

Adding new content to a website is always on the mind of a web developer, but it takes time. RSS feeds allow you to add lots of new content for your visitors to enjoy without actually creating it. While you may think this is too good to be true, it’s not. RSS feeds provide extra content for your website like stock prices or weather and help promote the source of the feed.

It’s a win win for both sides, but make sure it belongs on your website. For example, if you run a toy website, don’t have a stock feed because it has nothing to do with your target audience.

What feed have you added to your website? Why do you want to add an external RSS feed in WordPress?

Author: Ron Helms

I currently work for GreenGeeks as a Support Technician. My primary roles are supporting our VPS and Dedicated server clients, as well as performing site migrations. With experience in the web hosting industry since 2009, there is rarely a question I can’t help answer. In my spare time, I enjoy gaming and working on cars as an automotive enthusiast.

Was this article helpful?

Related Articles

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.