3 Ways to Exclude Content from WordPress Feeds

Published Wednesday, June 11, 2008 @ 10:12 am • 10 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

10 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! :)

Subscribe to comments on this post


Share your thoughts..

TopRead official comment policy

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

automation is great: i've got photoshop batch processing 300+ images while FTP is simultaneously uploading them to the server..

Perishable on Tumblr

Tons of Firewalls

Tuesday, 7 October 2008, 1:45 am

Recently overheard on conservative talk radio (instructing listeners how to obtain a free promotional video from their new website):

“This website has tons and tons of firewalls, so you have to use your real email address to download the video..”

The Quiet Search Revolution

Monday, 6 October 2008, 12:15 pm

Just a thought.. As awesome as Google is these days, it would suck if they ended up owning the entire search-engine business. When they get to the point where all competition is impossible (due to their sheer size, financial resources, media influence, etc.), how many alternate search engines will have the resources for continuous improvement and top-quality search results? When this happens, we will have no choice but to do exactly what Google tells us to do.

As deeply ingrained as it is for everyone to instinctively and unthinkingly turn to Google for their search activity, it is time to leave a few alternate search tabs open for as much use as possible. Instead of using Google just because that’s what you always do, try your search on MSN, Yahoo, Ask, or any of the other independent search engines instead. Sharing traffic with other search engines is a nice, quiet way to keep the competitive spirit alive and well in the search-engine business.

Disappearing WordPress Posts

Wednesday, 1 October 2008, 7:50 pm

Today I experienced difficulties while trying to publish or even save new posts in WordPress. I would compose the post as usual, add all of the keywords, tags, meta tags, and so on, but as soon as I clicked the “Publish” or “Save” button, the post would just disappear from existence.

The weird thing is that during the drafting process, WordPress’ default auto-save feature showed that the post had been saved at expected intervals. Unfortunately, after trying to publish several different posts, WordPress showed absolutely no record of the posts ever being created. They simply vanished into thin air.

Fortunately, a little investigation revealed the culprit. If you should find yourself dealing with this same issue, here are some different things that you should try. First, re-upload fresh copies of your entire WordPress installation. I don’t know why exactly, but apparently various files can either go stale or completely disappear from the server. Overwriting or writing fresh files may do the trick.

If that doesn’t work, check your WordPress database for errors. In my case, a little investigation revealed that something had caused a couple of fatal errors in the wp_posts table. Fortunately, checking and repairing the table solved the issue.

Tumblr Battles

Wednesday, 1 October 2008, 5:30 pm

Please excuse the duplicate Tumbr posts.. seems there is no way to ping Tumblr to refresh/rebuild the RSS feed according to changes in post content. So, to resolve the issue I have discussed now like two or three times regarding paragraph elements and proper feed formatting, I have no choice but to repost a majority of my text posts.

This is necessary for the proper import and display of my Tumblr feed into WordPress. Currently, there are five items displayed at once, each styled according to proper inclusion of paragraph tags. Thus, whenever the Tumblr feed “forgets” to enclose single-paragraph posts with the proper tags, the result is an unstyled post entry displayed on my site.

Assuming that makes sense, you will please excuse my dust while I repost a few older entries in an attempt to reconstruct (the hard way) a properly formatted Tumblr feed.

More Optimization Measures

Wednesday, 1 October 2008, 5:27 pm

Another important step in improving the performance of my recent redesign involves the optimization of both CSS and JavaScript content. During development there were around 15 server requests for these two types of files, 10 JavaScript files and 5 CSS files. This was okay for my own use, but would not work for production purposes.

Optimizing these file types involves consolidation, compression, and caching. Consolidation of 10 JavaScript files into three is huge improvement. Now I deliver one JS file for the functionality of the site, one for Mint, and another for Analytics. Likewise for the stylesheets; after consolidation, a single stylesheet is delivered to all modern browsers. There are two additional stylesheets as well, but they are targeted at IE6 and mobile browsers and will not load elsewhere.

Once the files were consolidated as much as possible, it was time to optimize or “crunch” them. Using the sexy Flumpcakes CSS optimizer, I was able to reduce my stylesheets by around 25%. Likewise for JavaScript, I used xtreeme.com’s optimizer to shave an additional 20% off the size of my JS content.

Finally, once I had consolidated and compressed my JS and CSS files as much as possible, I wanted to further my optimization efforts by ensuring that these files were cached by the browser. By setting far-future Expires headers for everything but the statistical files, my site gains an additional performance boost by eliminating the need to reload preexisting content.

Read more on Tumblr..

Subscribe to Comments Recent Dialogue

  • Adam Singer: Thanks for this. You're right, if it isn't broken, don't fix it. I was about to update my permalinks and install a plugin to redire...
  • Marilyn: It looks great on my browser! I wish I had that much creativity in my head! It's gorgeous!...
  • Randy: "Too girly?" It looks like a great design. Define "too girly!"...
  • Christopher Ross: .htaccess based redirects are wonderful. I'm always baffled by web professionals who don't take the time to learn more about them....
  • federico: Hi Jeff... tnx so much...it worked perfectly... c u Federico...
  • Cooltad: The skin seems (mostly) fine in my expert opinion. Your one of the few people able to make a design with a transparent table and a b...
  • Neal: The free Intro to Linux book is a great place to start http://www.ischool.utexas.edu/mirrors/LDP/LDP/intro-linux/html/index.html ...
  • Louis: @Jeff: Your “Archives” page is slick, although I would expect a cleaner implementation from such a vehement advoc...
  • Jeremy: Well I think that you may be over-critical, I don't see a darn thing wrong with it - I like it a lot!...
  • Jeff Starr: Alright, this is exactly the kind of information I was hoping to get. Lots of great ideas and recommendations here. I will be reading...

Read more recent comments..