Feed Wrangler

Feed Wrangler is a simple plugin that allows one to create custom feeds for their WordPress blog. You can customize the structure of that feed by creating a corresponding file in your blog theme, otherwise the custom feed will default to your RSS2 feed.

Feed Wrangler screenshotMain settings screen where you can create new feeds and manage existing ones

Some possible use cases:

  • You want a custom URL to access a feed by (i.e. “/feed/misterspecialfeed” )
  • You want some feeds to bypass Feedburner redirect.
  • A sponsor asks you to place an ad in your feed
  • You need a clean, ad-free feed to provide a partner (see Amazon Kindle), that doesn’t go through FeedBurner or is customized in any way.
  • You prefer adding and editing feeds in a way more analogous to Movable Type

Download Feed Wrangler 0.3.1

I’m intrigued by this plugin, but not sure I understand exactly how to deploy it. I’m interested in using it to bypass the FeedBurner redirect (I have the FeedSmith plugin installed) by creating a second feed that I can then direct to a second FeedBurner redirect (yeah).

I’m essentially looking to separate an “all post” feed (including aggregated content) from a “mysite.com/tag/mysite/feed” feed (for just my original content). The FeedSmith plugin causes a 404 with that second, original post feed (presumably because all feeds on my site are being redirected to the first FeedBurner feed, the “all post” one). If I create a feed with Feed Wrangler, what exactly keeps it from being redirected to the first FeedBurner feed by the FeedSmith plugin? Any guidance you could offer would be greatly appreciated, ’cause I sort of don’t know what I’m doing.

What I sent to Lewis, in case it’s helpful for others:

1) Go to Feed Wrangler admin and create a new feed. For the sake of this example, name the feed slug: “mysitefeed”. This means you’ll be able to access this feed by going to: “yoursite.com/feed/mysitefeed” (and actually “yoursite.com/mysitefeed/” will work too).

2) Go to your active theme directory and create a new file called “feed-mysitefeed.php”. The file name you’ll need to use will be listed in the Feed Wrangler admin.

3) If the file is blank, going to “yoursite.com/feed/mysitefeed” will give you a blank page.

4) Now you’ll need an RSS feed template to populate that file. Grab the contents of “/wp-includes/feed-rss2.php” and paste that into the “feed-mysitefeed.php” file. When accessing your feed, you’ll now notice that it’s a default RSS feed for all of your site’s post.

5) Now, we’ll want to change that feed to only include posts from your special tag. So open the “/wp-includes/feed-rss2.php” file for editing and add the following code (change it so “tag=test” points to your proper tag i.e. “tag=yourtag”)


< ?php
// Customize the query for this feed, below example
// pulls post from the "test" tag.
query_posts('tag=test');
?>

it should go right before this line:


< ?php while( have_posts()) : the_post(); ?>

6. Now accessing the feed “yoursite.com/feed/mysitefeed” should give you a feed with ONLY the posts in that tag. You can now create a new feed on FeedBurner.com and point it to this feed address.

Cool idea, now i give a test and extend the possible use cases.

Keep the good work!

I followed your instructions but I get the full feed when I go to the new feed I created. Without the rss2 file content I get an empty page and with I get the full feed. I made sure I placed the filter comment in the location you identified (query post = my tag) but It seems like it’s being ignored… any thoughts?

I love this plugin, it’s solving a major problem I’ve had with http://todo.bradyjfrey.com – how to customize the feed so some of these post url’s go to the main page… however, following your query directions, how would I do an if and statement in this file without bombing it? What I’m after is:
1. If the category is tagged completed, use the following template tags…
2. If it is not tagged completed, then use these template tags…

Any advice as I tinker? Thank you!

Brady and I exchanged a few emails and here are some details that might be helpful for other people in light of our conversation:

Within your feed template:

When you are in the following loop: < ?php while( have_posts()) : the_post(); ?> you are iterating through individual posts.

For each individual post, you can run the following check:


< ?php if (in_category('completed')) { ?>
<title>Complete: < ?php the_title_rss() ?></title>
< ?php } else { ?>
<title>< ?php the_title_rss() ?></title>
< ?php } ?>

This would prepend the title element with “Complete: ” if a post is inside the “completed” category

This is precisely what I needed – a way for my main site’s RSS reading code to bypass the Feedburner feed and get it straight from WordPress, all the while letting users still subscribe to the Feedburner version. Thanks a lot for this!

Is there a way that I can pass GET variables to this feel i.e: /feed/custom/?catid=3

I’d like to pull some dynamic information without making a ton of different custom feeds.

Thanks again, Ephram – your fix was the trick I have been looking for ever since I launched http://todo.bradyjfrey.com. Let me know some day if I can return the favor!

After trying everything I could think of to add a different feed I tried this plugin. I could only get the default RSS2.0 feed even after adding a custom feed to my theme folder.

I don’t really need to create a lot of feeds, only one custom one. Is there a simple way to do this?

I tried the code on the forum, but I couldn’t get that to work either.

Hi, Ephram! Thanks for the plugin! :)

I managed to use it perfectly on WordPress 2.5. However, when I upgraded to 2.6, I started having problems.

Whenever I create a new template, it shows up (correct) but when I reopen Feed Wrangler control panel or create a new template the first one is gone! Of course, WP does not recognize it as a valid template.

Any idea of what may be causing it?

Cheers,
Mateus Moraes

Mateus — the plugin needed a tweak to accomodate some changes in 2.6.

I just uploaded the new version (0.2) that should address the problem you’re seeing.

Version 0.3 works fine in WP 2.6, thanks!

Hi, Ivan!

I’m here to publicly thank you for all the support you gave me.

FeedWrangler became very handy by allowing custom feeds for my new project, ZapShows (http://www.zapshows.com).

I’ve written an open letter so you can be sure I’m really grateful for your help. You can read it at the WP Forum: http://wordpress.org/support/topic/194623

Feel free to spread the word and to tell me your thoughts about the project.

Take care and keep up the good work.

Best regards,
Mateus Moraes
http://www.zapshows.com

Hi Ephram,

I’m looking for a plugin to help me sort out a few issues, maybe Feedwrangler is what I need.

Would it be possible to create a feed with todays items only?

Can Feedwrangler handle the more tag correctly, so that the post isn’t cut off in the wrong place?

Best regards,
Stellan

I’ve installed Feed Wrangler as per the instructions – but I can’t even see it in Plugin Management.
(My verson of WordPress is 2.6.1)
When I get it activated, what code do I put in a HTML page to insert my current post into that page?

Is it possible to save the feed file as a permanent file within the Feed Wrangler plugin directory that could then be used elsewhere. E.g. ‘feedfile.xml’?

Hi Ephram! Thanks so much for this plugin – it really simplifies things.

My question isn’t about the plugin, as much as it’s about how I’m using it… and you seem like a pretty smart guy, so I figured it can’t hurt to ask. :)

I need a feed that simply excludes posts that contain a given tag. I’ve created the feed, and copied the RSS2 content into it. I just don’t know how to modify it to only include posts *not* tagged with the given tag.

(For your reference, in case you’re able to work up some code for me… The feed slug is hard-news, and the tag I want excluded is misc, tag ID = 12.)

Any help would be appreciated!

Hi there. Got problems:

- install & activate plugin, submit new feed name slug as “yandex”
- copy feed-rss2.php into using theme dir and rename it as “feed-yandex.php”
- got 404 error when I try to reach it blogurl/feed/yandex

What have I do wrong? Please excuse me for my crap english.

It works fine for me but I even though I can customize different versions of the default RSS feed I cant seem to be able to actually access the RSS feed to a specific category.

My question is, now that I have a custom RSS feed, how do i get it to display content only from a specific category?

In your new feed template, you can add the follwoing

< ?php query_posts('category_name=Category Name'); ?>

It should go right before:

< ?php while( have_posts()) : the_post(); ?>

Here are more details on how you can specify the query_posts() for categories:

AWESOME!!!!

I’m using version 0.3 with WP 2.7.1
Your readme file says:
“If you want to start off with one of the default templates — let’s say RSS2 — just copy and paste the code from `/wp-includes/wp-rss2.php` into the new theme file and make the changes and additions you see fit.”

There is no wp-rss2.php file in the wp-includes directory. Do I use the feed-rss2.php instaed?

Thanks

Hey Jsherk – you’re right. I updated the plugin instructions to reflect the changes in file names. Thanks for your help.

Hi Ephram,

I posted a comment a while back but never actually got around to installing your plugin. I’ve just done it this weekend and It’s magic. Very easy to use and install. Sorted my problem.

Thanks!

I have been using your plugin for the past year in tandem with Justin Tadlock’s “Custom Fields for Feeds” plugin and it’s worked beautifully, but now after upgrading to WP 2.8 I can no longer get the custom feed to work properly. The custom feed is called “zdd”. Now, when I go to (wp root)/feed/zdd/, I get a “not found” error, and when I try going to (wp root)/feed/?feed=zdd it simply says “ERROR: zdd is not a valid feed template”. All looks good in file feed-zdd.php within my theme, and it shows up normally in the Feed Wrangler admin. The stock WP feeds (rss2, etc.) all seem to be working normally. This WP install is located at http://is.gd/1q1AF. Thanks!

I have been using Feed Wrangler 0.3 since vWP 2.7.1 and am now using 0.3.1 with WP v2.8.4 without problems as well.

Thanks for a great simple plugin!!

Thanks for the plugin, Ephram!

Cinestar asked how one would display content from a specific category.
I have done so with

[wordpress root]/[category]/feed/[my-feedwrangler-template]

Great plugin, thanks! This is just what I was looking for.

One niggle: I’m using a “child” theme, based on Thematic. TEMPLATEPATH doesn’t do the right thing with child themes – the advice is to use locate_template instead.

So, around lines 106-120 of feed-wrangler.php can be changed to this: http://pastie.org/915759

Cheers!

Hey Ephram,
It appears that Feed Wrangler may not (yet) work under WordPress 3.0, though it could be something else in my installation. Do you have plans to update it?
Thanks!

Anyone tried this with WordPress 3.0 yet?

Going to look into 3.0 compatibility soon.

I am using Feedwordpress and that works, however, it won’t import images. I want the images too and am tired of beating my head against the computer screen.

As far as I can tell it *does not* work in 3.0.

In Feedburner, when I try to burn the feed, I get this message:

We could not find a valid feed at that address. Here are some possible reasons this might have happened:

But when I check the feed validation, it’s fine…

Hmm…

Any progress with WP 3.0 compatibility, yet? I can’t use the plugin until then and I REALLY need to.

Thanks!

I tested WP 3.0 and it looks like it works. If there are specific things that aren’t working for you, just let me know.

Hello,
Thank you for the information on this plugin. I was having some big troubles with the feedburner feedsmith plugin but with the directions on this site I was able to get them fixed. It’s nice to finally have the RSS FEED widget finally working.

Hi Ephram-

Great plugin, we’ve been using it for the last year. We are just now upgrading to WP3 (specifically from 2.9.2) to WP 3.0.3, and the fly in the ointment now is feedwrangler. On our old site, we have a feed here that is working great:

http://www.goodlifeteam.com/feed/googlemaps/

On our WP 3.0.3 development site, we have exactly the same feed wrangler settings and the same php file, but I’m getting a ‘not found’ error, and this in the error log:

[error] [client 71.20.91.36] File does not exist: /var/www/wordpress/feed

this is our dev feed link:
http://dev.goodlifeteam.com/wordpress/feed/googlemaps

Any thoughts?

Jack

Ephram-

Never you mind, I figured it out after much mucking with our apache config. .htaccess was disabled, which caused a whole cascade of errors including feedwrangler.

Thanks!

J

Hi Ephram,
Sadly, Yoast WordPress SEO is still breaking Feed Wrangler. The custom feed template never gets called. I contacted Yoast about it months ago, but the lastet versions don’t seem to be addressing the situation. Ultimately, I’ll choose Wrangler over Yoast if I have to, but I’d really like the two to function together. Can you point me in any direction?

Scratch that – I just figured out the conflict….
Yoast WordPress SEO is stripping the “feed” parameter to make the URL friendlier. You can keep it from doing so by going to
SEO->Permalinks,
and either unchecking “Redirect ugly URL’s to clean permalinks”, or if you want that checked, by adding “feed” to the “Other variables not to clean” list.
Glad to get that resolved!

Lifesaver! Thanks :-)