It’s a little known fact that WordPress contains it’s own RSS parser, and you can use it to your advantage to make custom dynamic pages!

This is a tutorial on how to take an ordinary RSS feed, parse it using WordPress’ internal RSS parser, and then create dynamic pages with it. I’m not talking about being a scraper, creating a splog, or doing anything spammy at all. I’m talking about creating added value for visitors and your blog while making money. We all know what a “splog” is. It’s a “spam blog”…or someone who takes RSS feeds and generates pages and posts from them and tries to profit using say Adsense or affiliate ads. The pages are just excerpts and titles from RSS feeds (sometimes full posts), and while they do link back to your site (usually) – they’re not the type of links you want to get. These spam blogs don’t have any redeeming value at all, no contact information, and certainly no original content at all.

Now – let’s take your blog, let’s say you have a birdwatching club in Buffalo, New York. You’ve developed a great site with loads of original content, bunches of articles, and your members visit regularly. The two things that you and other members talk about regularly are binoculars and digital cameras. This is what you could do…

Craigslist is America’s garage sale. If you don’t live in America, I’m sure something like this is in your region. Craigslist offers RSS feeds on each and every page. Here’s how the birdwatching club could benefit from that.

First – create a page template. From your WordPress theme directory, download “single.php” (or the theme template that creates post pages) to your desktop. Open it in Notepad or any text editor, and add the following lines of code to the top:

/* Template Name: Craigslist Template */ ?>

This is the tricky part, because each and every theme is different. You need to look for the following block of code (which is what prints the page content out):

<div class="entry">
<?php the_content(__('Read more &raquo;')); ?>
</div>

Right after those lines (or “the loop” in your template, you want to copy and paste this code:

<?php include_once(ABSPATH . WPINC . '/rss.php');
wp_rss('http://example.com/rss/feed/goes/here', 5); ?>

That code comes from this page in the WordPress Codex. WordPress has a built in “RSS Parser” that will read any RSS feed and spit out a list of links is list ordered fashion to a page. So, if you visit the Buffalo Craigslist Photo page, you’ll find at the bottom of the page a little orange RSS icon. Click on that link, and then copy the URL, and paste it over the example URL in your template. The number (20) that comes after the URL is the number of items from the RSS feed to parse and display. Save the template, and upload it back to your theme directory of your WordPress blog.

In your WordPress Dashboard, go to “Write -> Page”. Type some original content in the box, and scroll down to the bottom (in WordPress 2.5, on the sidebar in <2.5) and select “Craigslist Template”. Title your page “Craigslist”, and then save and publish the page. Now if you go to www.yourblog.com/craigslist you should see a listing of things from craiglist with your original content on top.

Look what you did, now the Buffalo Birdwatchers Club won’t can look at photo equipment right on the member web site without having to go to Craigslist unless they see an item they like. You can add multiple feeds to the same page, just copy and paste that code block in multiple times with different RSS feed URL’s. Just remember, the more your add, the longer they take to parse, and the longer the page will take to load. I loaded 6 feeds @ 20 items per feed, and the page took about 20 seconds or so to load.

This Craigslist example is just that – an example. If you want to see how this looks in realtime, look at this Craiglist RSS example I just built. You could use RSS feeds from just about anything, digg, google news – any site that has a feed. As long as you’re only using headline feeds and not stealing content – nobody should ever think you’re plagiarising them in any way, you’re sending them traffic. In your template file, before you parse the feeds add a few paragraphs of original content about what they user might find (on Craigslist – or whatever) and now you have a page with ever changing (daily) content, AND orignal content that google can index!

Now, how do you monetize this? Well, use your noggin and add some affiliate banners, adsense, or other items above, below, or in your sidebar. There is a better way to monetize without using these though…

eBay has RSS feeds – don’t they?  All you have to do is add your affiliate code to an eBay RSS feed, and you could use it instead of the Craigslist feed for a list of eBay items, and every time someone clicks, bids, and buys an auction you profit! First you have to be a member of the eBay Partner Network (EPN). Once logged in go to “Tools->Widgets->RSS Feed Generator”. Then just enter in what you’re looking for. Like Craigslist, you can “geo-target” what you want by scrolling down and checking “Items within 50 miles of xxxxx zip code”. Then click “search” and the page you get should be auctions for only that area. Again, scroll to the bottom of the page and see the orange RSS icon. Click on it and copy the URL and use that as the URL in the code block in your template, save the page now your blog page will list eBay auctions! The difference between these listings and Craigslist is that you profit from each won auction click on these.

I’ve just given you a few ideas, the sky’s the limit with these. You could probably do the exact same thing with Amazon. Now, there’s one thing I didn’t tell you, often people want to know how to take an RSS feed an automatically create blog posts from the feed and publish them, kind of like what’s called an “auto-blog”. Let me state first that there are very few legit reasons to do this, because of duplicate content issues in google, etc. Most people want to use this to try and create quick spammy blogs with no original content, but there are (just a very few) legit reasons to want to create posts from an RSS feed (like doing a blogroll type page for members of a larger community). You can do that easily (and freely) with RadGeek’s Feed WordPress Plugin.

Now, get hacking, come back to comment and tell me what you’ve come up with!

John Pratt runs JTPratt Media, a WordPress development company specializing in custom plugins, custom themes, and website security and hardening. They have been building WordPress websites since 2004, and have created and maintained several popular plugins in the official repositories.

  1. Kyle Eslick says:

    @ John – Great write up with a lot of very useful information!

    Our hope is of course that everyone uses this information responsibly! :mrgreen:

  2. Leland says:

    I can honestly say I have never heard of this feature before in WP. Very interesting post, John.

  3. Rarst says:

    Thanks for interesting info. I display custom feed with software updates in my sidebar with wordpress widget but it is not very customizable. I looked at codex link and around and I might be able to re-code it to something better.

  4. Kolia Shlapak says:

    Intresting to read but I don’t think I will you use it in practice

  5. Great article, John. I was about to start looking about splogs and how they works.

  6. Raj says:

    Great tutorial. You’ve taken a lot of effort to write this. The wp_rss function has been deprecated in version 2.8.3. Please update the article or write a fresh tut for the new rss api.

  7. John says:

    Hey, you guys should check out http://superfeedr.com. It really is very useful and avoids the hassle to poll over and over the same feeds.

  8. Lara says:

    Hiya — so I’ve used this feature in a client’s site here for the FB updates:
    http://greenmommyblog.com/

    However, the problem is that it can sometimes take an hour or even longer for an update to appear. What do you think the problem is here/

    Lara 🙂

  9. Rafael says:

    Here is a easy to use script that i use for my website

    Hope that helps someone

Trackbacks/Pingbacks »

  1. A Playoff Worthy Lineup Of Links - This Month In SEO - 9/08 | TheVanBlog | Van SEO Design says:
  2. Customizing your Wordpress Theme – Part 2 | Neowster says:
  3. Customize your WordPress Theme | Neowster says:
  4. WPMU Tutorials » Revisiting parsing a feed says:
  5. 250 Wordpress Tutorials says: