Deleting all RSS feeds in IE7

Wed, August 2, 2006, 02:46 PM under IE7 RSS

We already looked at how I deleted all the feeds in Outlook 2007 in one go, and not one by one.

Luckily IE7 understands folder structures from opml but somehow I managed to get them all in a flat list in IE as well (probably outlook messed that up for me or maybe a glitch with IE7 Beta 2 that I was using or something else, not important now).

So how do you delete all feeds in IE7? Out of the box you can't. Fastest end user way would be to create a folder and drag them all in it one-by-one and then delete the folder - yuck!

Another way is to be stupid and delete the contents of the Windows RSS Platform store directly (after shutting down all apps that use it, including IE7 of course). The feed store currently (Beta 3) is here:
"[drive letter]:\Documents and Settings\[user name]\Local Settings\Application Data\Microsoft\Feeds\[your feeds and folders]"

For me however, this was the opportunity I needed to test drive the RSS API. Unfortunately, it is so easy to use that I could achieve what I wanted with a dozen lines of code so here is my simple effort:

using Microsoft.Feeds.Interop;

class Program
{
static void Main(string[] args)
{
IFeedsManager fm = new FeedsManagerClass();
IFeedFolder ff = (IFeedFolder)fm.RootFolder;
System.Console.WriteLine("Starting deletion at root");
DeleteFolder(ff);

System.Console.WriteLine("Deleted all feeds!");
System.Console.ReadLine();
}
private static void DeleteFolder(IFeedFolder ff)
{
DeleteFeedsInFolder(ff);
System.Console.WriteLine();

foreach (IFeedFolder sf in (IFeedsEnum)ff.Subfolders)
{
System.Console.WriteLine("Deleting subfolder '{0}'", sf.Name);
//DeleteFolder(sf); //not needed really but it can demo recursion
sf.Delete();
}
}
private static void DeleteFeedsInFolder(IFeedFolder ff)
{
foreach (IFeed feed in (IFeedsEnum)ff.Feeds)
{
System.Console.WriteLine("Deleting feed {0}", feed.Name);
feed.Delete();
}
}
}
Also note that the code should explicitly release the COM objects. In other words, wherever you have a reference to an object, when you are done with it call:

System.Runtime.InteropServices.Marshal.ReleaseComObject(f);

Wednesday, 05 March 2008 09:43:00 (Pacific Standard Time, UTC-08:00)
Sweet, you just saved me 15-30 minutes. I dropped your code in a ConsoleApplication and it worked perfect.

Thanks!
Wednesday, 05 March 2008 09:45:00 (Pacific Standard Time, UTC-08:00)
Oh, is there a similiar way to delete the RSS feeds out of outlook 2007? I noticed your post about using outlook 2003, but i don't know if I want to go find a copy and install it and tweak with my exchange stuff.

Thanks again.
Friday, 17 April 2009 13:20:00 (Pacific Daylight Time, UTC-07:00)
Well, I don't have Visual Studio and I'm not savvy with how to create a console application. For the rest of us, if you use Window's Live Mail to view RSS also, when you delete an RSS feed from there, there's an option to delete the RSS feed in IE also. It's also easier to delete the feeds from there because you can put them all in a folder then delete the entire folder. I learned the hard way by first deleting all 300+ feeds from IE then I moved on to Windows Live Mail. Just do Windows Live Mail first. In fact, it would be slightly easier to import your IE feed to Windows Live Mail then delete them both in Windows Live Mail.
Comments are closed.