Cotton Rohrscheib

The Cotton Club Blog & Podcast

  • Home
  • About
    • Entrepreneurial Journey
  • Blog
    • Collecting
    • Faith & Family
    • Marketing & Tech
    • Farm & Business
    • Entertainment
    • Health & Wellness
    • Urban Farming
    • Weekend Projects
  • Podcast
  • Newsletter
  • Media
    • Photo Galleries
    • Video Archives
  • Marketplace
    • Buying Gold & Silver
    • Accoutrements
      • Bags & Briefcases
      • Notebooks
      • Personal Carry
      • Wallets
    • Antique Fishing Lures
    • Artwork
    • Coins & Currency
      • Silver Certificates
      • Gold Banknotes
      • Currency
      • Coin Sets
      • Individual Coins
    • Sports Memorabilia
    • CIvil War Relics
    • Drones
    • Native American Artifacts
      • Individual Pieces
      • Groups (Cache)
    • Pens
    • Rare Books
    • Signs & Advertising
    • Stock Certificates
    • Trading Cards
      • Trading Cards: Autographs
      • Trading Cards: Base
      • Trading Cards: Graded
      • Trading Cards: Raw
      • Trading Cards: Pokémon
      • Trading Cards: Sets
    • Sports Memorabilia
    • Vintage Toys
      • Buddy L
      • Ertl Farm Toys
      • GI Joe
      • Masters of the Universe
      • Hot Wheels
      • Lionel Trains
      • Lunch Boxes
      • Marx Toys
      • NASCAR Die-Cast
      • Schleich Toys
      • Star Wars
      • Tonka Trucks
      • Walt Disney Productions
    • Vintage T-Shirts
    • Vinyl Records
    • Watches & Jewelry
    • Workshop
      • Building Hardware
      • Camping & Outdoors
      • Tools
      • PCMCIA Cards
      • RAM Memory
      • Microcontrollers
      • CPUs
      • Laboratory Glassware
  • Connect
You are here: Home / Marketing & Tech / Creating an RSS Feed from Wordpress Tags

Creating an RSS Feed from WordPress Tags

November 14, 2012 by Cotton Rohrscheib Leave a Comment

One of the things that WordPress really does well in my opinion is generate feeds out of the box for posts, and even feeds for post categories are fairly easy to pull together, but today I was needing to put together an RSS feed from post tags. For those of you that might be unfamiliar w/ WordPress taxonomy, you basically have posts that are organized in categories but are refined more specifically using tags (or at least that’s how I teach my clients to leverage wordpress when publishing content, I have seen it done differently though, to each their own).

Since there really isn’t a good plugin to drop in and generate an RSS Feed from post tags, I had to resort to a hack (usually I’m not a fan of doing this). I went in and edited the wp-includes/feed-rss.php file and added the following lines of code just under the php header() call:

$tag = (urldecode($_GET['tag']));
if (!empty($tag)) {
    query_posts("tag=$tag");
}

Here’s what it looks like before:

<?php
/**
 * RSS 0.92 Feed Template for displaying RSS 0.92 Posts feed.
 * @package WordPress
 */

header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
$more = 1;

?>
<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>

and here’s what it looks like afterwards:

<?php
/**
 * RSS 0.92 Feed Template for displaying RSS 0.92 Posts feed.
 * @package WordPress
 */

header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
$more = 1;

/* generate rss feeds for tags */
$tag = (urldecode($_GET['tag']));
if (!empty($tag)) {
    query_posts("tag=$tag");
}

?>
<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>

Once you have dropped this code into the feed-rss.php file and uploaded it to your wp-includes directory, you should be able to pull up an RSS feed based on tags by using the following URL structures:

  • http://www.yourwebsite.com/feed/?tag=tag-name-here
  • http://www.mysite.com/feed/rss/?tag=tag-name-here

 

Thanks to http://www.ebrueggeman.com/ for sharing this!!

Share this post on:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Email a link to a friend (Opens in new window) Email
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Pinterest (Opens in new window) Pinterest

Filed Under: Marketing & Tech Tagged With: RSS, RSS Feed, Wordpress™, Wordpress™ Tags, Wordpress™ Taxonomy

About Cotton Rohrscheib

The Cotton Club is a monthly podcast hosted by me, Cotton Rohrscheib. I'm a 52 year old entrepreneur w/ ADHD, OCD (and now AARP) that refuses to grow up as I grow old. I have collaborated and invested in hundreds of projects throughout my career in multiple industries such as; technology, healthcare, and agriculture. I also have 25 years experience in the marketing industry as a co-founder of an award-winning advertising agency. I will undoubtedly cover a wide variety of topics on my podcast while sharing some really crazy stories and situations that I've been fortunate to witness firsthand. I also have a book coming out in 2025 titled, "Mistakes were Made"

Leave a Reply Cancel reply

You must be logged in to post a comment.

  • Email
  • Facebook
  • Instagram
  • LinkedIn
  • Twitter

Recent Updates

  • These are the Hall of Fame Player Cards and Rookies from the “Junk Wax Era” of 1986-1994 that I have in my Raw Card Baseball Collection.
  • Ep035: Cotton Rohrscheib & Mark James Discuss Old School Memphis Wrestling
  • Collecting Classic Southern Rock Vinyl Albums
  • Upcoming Podcast w/ World-Renowned Author & Memphis Wrestling Historian Mark James
  • Monthly Garden Update – May 2026

Blog Categories

  • Blog (450)
  • Collecting (10)
  • Entertainment (380)
  • Faith & Family (155)
  • Farm & Business (305)
  • Health & Wellness (38)
  • Marketing & Tech (595)
  • Podcasts (34)
  • Urban Farming (25)
  • Weekend Projects (16)

Blog Archives

Join the Cotton Club!

 

Content Copyright © 2000-2026
Cotton Rohrscheib | Rohrscheib Capital
Disclaimer | Privacy Policy | Account Manager | View Cart

All opinions expressed on this website are 100% Cotton (see my disclaimer). All content, including text, images, and media, are the intellectual property of Rohrscheib Capital unless otherwise noted. To learn how we use your private information, checkout our privacy policy.