3 Ways to Exclude Content from WordPress Feeds

Published Wednesday, June 11, 2008 @ 10:12 am • 20 Responses

~{*}~ This may surprise you, but I post quite a bit of content that never appears in the site’s main feed. It is my impression that a vast majority of subscribers are interested in web/graphic-design and development-related topics, and are really much less interested (if at all) in the miscellaneous odds and ends that wind up in the ever-expanding Perishable Press database.

In the past, the process of excluding content from the main feed typically involved changing the post-date to something at least a year or so in the past. The thinking was that I could always return to these posts at some point in the future and put them back into sequential order. Although effective, this process quickly became far too tedious and time-consuming to prove practical. Keeping my eyes open for possible solutions, I have accumulated several excellent techniques for excluding content from WordPress feeds.

Excluding categories without a plugin

The first method I discovered involves excluding one or more categories from the feed by simply editing the feed URL itself. As Jaypee explains, it is possible to exclude any category n by appending a query string to the feed URL like so:

http://domain.tld/feed?cat=-n

..where n is the ID of the specific category you wish to exclude. Likewise, it is also possible to exclude multiple categories x, y, z as follows:

http://domain.tld/feed?cat=-x&cat=-y&cat=-z

..where x, y, z represent any three excluded categories, etc.

Of course, the upside to this method is that it doesn’t require a plugin in order to work. You can simply link directly to the filtered feed, invoke some htaccess voodoo, or even make the required changes via Feedburner, if that’s your thing. The only real downside involves potential loss of subscribers after switching the feed URL, but again, this may be easily resolved via htaccess or Feedburner.

Update: Mimi suggests an alternate approach for versions of WordPress with which the above feed format doesn’t work. Thanks Mimi! :)

Excluding categories with a plugin

If you would like to exclude categories without fiddling with your feed URL(s), check out the Ultimate Category Excluder plugin from Michael Clark. According to Michael, the Ultimate Category Excluder plugin “allows you to quickly and easily exclude categories from your front page, archives, and feeds.” — But it’s even better than that: for each excluded category, you have granular control over where the category’s posts are excluded. So you could exclude your “Milk” category from feeds only, your “Monkeys” category from both archives and feeds, and your “Pancakes” category from all three (front page, archives, and feeds). It’s entirely up to you and completely configurable via the WordPress Admin. Most importantly, though, this plugin is an excellent way to exclude category content from feeds. Note: This plugin has been tested officially only on WordPress 2.1, but I have been using it with great success on WordPress 2.3 as well.

Exclude individual posts

Rather than excluding an entire category from appearing in feeds, you may prefer granular control over individual posts. The Stealth Publish WordPress plugin by coffee2code prevents “specified posts from being featured on the front page or in feeds.” After installing the plugin, simply “unfeature” any post by assigning a “stealth-publish” custom-field value of “1”. All such unfeatured posts will be excluded from all feeds as well as the front page. This free plugin is compatible with WordPress versions 1.5+, 2.0+, 2.1+, 2.2+, 2.3+, and 2.5+. I am currently using this plugin here at Perishable Press and it works perfectly :)

..and I’m out!

Using one of these techniques, excluding content from your site’s main feed is a snap. If you know of other techniques, please share them by leaving a comment below. Thanks!


Dialogue

20 Responses Jump to comment form

1jeeremie

August 16, 2008 at 3:05 am

Thanks. That was a very useful information. However, I guess the first solution won’t work if someone subscribed to feed before you changed the url, which is my case.

2jeeremie

August 16, 2008 at 3:11 am

Actually, I have just tried Ultimate Category Excluder plugin and it didn’t work in Wordpress 2.6. I had to unistall it.

3Jeff Starr

August 17, 2008 at 6:37 am

Thanks for the info, jeeremie. Hopefully Michael will update the plugin soon. In the meantime, check out the Stealth Publish Plugin (third option). I use it here at Perishable Press and just love it. Hopefully it works with the latest version of WordPress.

4Mimi

September 25, 2008 at 1:38 pm

The code used to exclude multiple categories from feeds doesn’t work. :( However, if you changed it to this, it works:

http://domain.tld/feed?cat=-x,-y,-z

5Jeff Starr

September 27, 2008 at 7:12 pm

Thanks for the heads up, Mimi! I think the difference in format has to do with different versions of WordPress. I have updated the article to reflect this information. Thanks for sharing with us! :)

6Rob Barrett

January 6, 2009 at 6:30 pm

Thanks for posting about the Stealth Publish plugin — just what I needed for my site. Works perfectly!

7Peter

January 9, 2009 at 11:52 am

Thanks for the great info. I’m just looking for this. I plan to use Stealth Publish WordPress plugin together with RSS Includes Pages plugin, to be able to select which page to be included in my RSS.

8August Klotz

January 19, 2009 at 4:57 pm

Actually, when using default query-string format for your URLs instead of permalinks, you may exclude categories from most WordPress feeds via any of their associated parameters, category name, category ID, or any combination thereof. Here are some examples:

http://domain.tld/feed?cat=-bananaz
http://domain.tld/feed?cat=-bananaz&cat=-33
http://domain.tld/feed?cat=-33&cat=-77
http://domain.tld/feed?cat=-bananaz&cat=-pancakes

And so on, etc. and and and. So much fun, you forget to breathe sometimes.

9Aaron

April 7, 2009 at 11:56 am

What if want to do the opposite. For example I’m aggregating content from a couple of friends using Feedburner and the FeedWordPress pluggin. I only want to include content of a certain tag or category instead of excluding categories as I may not know what categories are available from the feed. So if its category “video production” then display…if not then ignore. I’m asking the contributors to tag or categories their content with a certain term and if that term exists then display otherwise ignore post. Help!!

10francois

April 14, 2009 at 11:17 pm

excluding with the category’s slug (like ?cat=-tweet) does not seem to work on my wordpress 2.7.1 install
however, here is a plugin that works: http://www.codehooligans.com/2008/04/27/simply-exclude-plugin/

11Ian

May 2, 2009 at 8:25 pm

Thanks for the tips, very helpful. Was able to exclude a category from my main feed without a plugin! Much appreciated :)

Subscribe to comments on this post


[ Comments are closed for this post. ]

If you have additional information, contact me.

Contact Perishable Press

  • Contact Jeff via form

Search Perishable Press

About Perishable Press

Perishable Press is the virtual playground of Jeff Starr — visionary, founder and lead developer of Monzilla Media, a small web and graphic design company in the lush desert oasis of Moses Lake, Washington. Perishable Press features articles and tutorials on many aspects of digital design..

Read more..

Perishable on Twitter

heading out of town on a photographic excursion. great way to break up the routine.

Perishable on Tumblr

Office painted a warmish/neutral off-white color. New 2.1...

Tue, 02 Feb 2010


New office digs..


Night view..


Potential..

Office painted a warmish/neutral off-white color. New 2.1 Altec/Lansing speakers for crisp, clear sound. Two new executive desks: one for computer biz and another workspace for drawing, painting, and other offline pursuits. And of course, a big, cushy black office chair to make it all sweet.

Quick Photoshop Reset

Tue, 19 Jan 2010

Very good Photoshop trick to know: If you hold down ALT+CTRL+SHIFT (Mac: CMD+OPT+SHIFT) while starting Photoshop you can reset all settings back to factory default. Very useful if you have problems with some tools or the interface. – http://bit.ly/4A5LJ5

Insane October

Sun, 01 Nov 2009

By far the most insane month of 2009, October included the following activities:

1st week: Trip to the East Coast, beginning with some business in Connecticut.

2nd week: East Coast trip continues with much pleasure in downtown Manhattan.

3rd week: Photo and art excursions with good friend visiting from Portland, OR.

4th week: Marathon book-editing and fine-tuning for Digging into WordPress.

Now that November is here, things remain busy, but I am hoping to get a chance to restore some balance and regain my equilibrium. Of course, the holidays are right around the corner..

Import Feeds to Facebook

Mon, 07 Sep 2009

Seems like a lot of misinformation and confusion out there on how to import and display your feeds on Facebook. Here is what worked for me:

1. In the lower left-hand corner of your Facebook account, click on “Applications” > “Notes”.

2. In the upper mid-right column, click on “Import a blog” in the “Notes Settings” panel.

3. In the “Import an External Blog” panel, enter your feed URL and check the little box.

4. Click the “Start importing” button and then click on “Confirm Import” on the preview page.

That’s all there is to it. Don’t forget to edit your “Notes Privacy” settings to ensure that people can see and comment on your imported feed items.

Once you successfully import your feed(s), they will appear by clicking on the “Notes” button in the left sidebar of your Home page. Also, your timeline or “Wall” will also display the most recent post from each of your feeds as they are published and pulled into Facebook. This makes it easy for your “Friends” to see what you have been up to elsewhere on the Web.

help me in plain english

Mon, 31 Aug 2009

This has got to be the most ironic comment I have ever read:

“hi i dun a stupid noooby mistake and dint think about encrytion i just put a pass in the change pass box and now when i attempt to see my main.php or index.php its sayin password no and error how can i reset back to having no password or were can i edit the bit so that a pass is automattically seen or if not posable how can i make it so i can put in the pass i made at some point so i can login this way? the 3rd is most prefered as this will help me with other projects i am planning as i am a php noob :s plz sum1 hu is clever help me in plain english”

Thanks, “jay” — you made my week with that one.

Read more on Tumblr..

Subscribe to Comments Recent Dialogue

  • kn33ch41: "But for good browsers such as Opera and Safari, most users are quite savvy, understanding the game and always keeping their browsers...
  • Paul: First off great list. Probably the one of the best I've ever seen. I enjoyed your limiting of The Wall, and Dark Side of the Moon. He...
  • kn33ch41: I use method three, and use method four when a selector only requires one property....
  • r-a-y: Great code. Just wondering if, in certain scenarios, a permalink can be longer than 255 characters. I can think of a weird exam...
  • Jeff Starr: Thanks Oliver! Glad you enjoy the book. Thanks for the great feedback :)...
  • Perry: I've read a number of these Image Preloading techniques today and would like to know the best approach to use. I use PHP 5.3 on th...
  • Infographiste PAO: I didn't know that Jeff, that's a kind of great news, usually ppl don't know about no or dofollow so now it's gonna be alright withou...
  • Bill Brown: @Jakub: Of course, there are many ways to bypass the XML declaration issue when you have PHP short tags enabled. Since the intenti...
  • bucabay: AT Jakub ...
  • Jakub Lédl: Oh sh*t, I came back. What happened to that code I posted? Does this CMS remove PHP from comments or what? I now look like an idiot :...

Read more recent comments..

Attention: Do NOT follow this link!