How to Modify SharePoint List RSS Settings Programmatically

RSS is a great thing. It streamlines easily the communication between a content provider and its readers. RSS nowadays are everywhere. News sites, blogs, content driven sites. By subscribing to a RSS feed you can reach a broader audience by eliminating the need of a computer, just have a mobile with RSS reader capabilities and you are good to go. As a powerful content management tool, of course SharePoint enables RSS syndication for its contents.
Let’s take a look at the UI page where we can configure the RSS feed of a document library:
So, can we customize the RSS features exposed by a SharePoint library programmatically ? The answer is yes, but unfortunately this task is not as straight forward as one might think.
If you look the SPList properties, you will not find anything related to them. If you look at the SPListItems, you will not find anything related to them.
So where are these properties? They are in fact in the RootFolder property of the list. The RootFolder is an object of type SPFolder and sets various properties for the files and contents associated with the list as a collection of items.
And guess where these RSS feeds settings are specified? Yes, in that same collection, exposed as a key-value pair. But even if you try to inspect that with your preferred tool, you won't be able to see it clearly. Not even with SharePoint Manager sometimes. For example, take a look at these 2 RootFolders properties, from 2 different SPLists, being visualized with SharePoint Manager.
So…You see, the first one does not expose any RSS related property values, but the other one does. That's because the later has  SPListTemplateType.DocumentLibrary as its base type.
Since the SharePoint operations and behaviours rely extremely on the exposed APIs, we would assume these are the kind of stuff you would have access via an API call. I for one was not expecting to modify straight into the property values of a key-value par exposed by a SharePoint collection itself. Yeah, pretty tricky. SharePoint does its own things by its own ways. 
Anyway, these are the things you can modify from our RSS settings screen:

1) EnableSyndication : internal property, refer to the code below
2) vti_rss_LimitDescriptionLength : Controls if the item content will be exposed complete in the feed of just the first 256 characters.
3) vti_rss_ChannelTitle : name the RSS feed
4) vti_rss_ChannelDescription : Short text to describe the feed
5) vti_rss_ChannelImageUrl : Specifies which image will be displayed when a RSS reader consumes the feed
6) vti_rss_DocumentAsEnclosure : Indicates if will any documents associated with the feed are included as enclosure. ( I assume, becaue I have not tested that to explain better )
7) vti_rss_DocumentAsLink : Indicates if you can expose the documents included in the feed as link direct to the file. Very common for podcast RSS feeds, for example.
8) vti_rss_ItemLimit : Limits how many items are going to be exposed in the feed
9) vti_rss_DayLimit : Limits how many days will the feed content display. This will work combined with the vti_rss_DayLimit; the most restrictive one, wins.

Also there are some more fields that are not exposed by the UI, but still exists in property collection:
vti_rss_DisplayRssIcon : Indicates if the image in the vti_rss_ChannelImageUrl is an icon file. It will be displayed in the navigation bar of web browsers, for example.
vti_rss_DisplayOnQuickLaunch : I did not test that, but I imagine it will add the feed to the quick launch links in the homepage.
After all the settings were done, there is one more catch: Call the Update() method not from the list, but from the RootFolder object.

Now, the code to set them:

    1         public void ApplyRSSSettings(Microsoft.SharePoint.SPList selectedList)
    2         {
    3             // display RSS for this list
    4             selectedList.EnableSyndication = true;
    6             // set NO to truncate RSS multiline text to 256 chars
    7             selectedList.RootFolder.Properties["vti_rss_LimitDescriptionLength"] = 0;
    9             // set NO to include file enclosures
   10             selectedList.RootFolder.Properties["vti_rss_DocumentAsEnclosure"] = 0;
   12             // set YES to link rss to files
   13             selectedList.RootFolder.Properties["vti_rss_DocumentAsLink"] = 1;
   17             // set RSS maximum items to 25
   18             selectedList.RootFolder.Properties["vti_rss_ItemLimit "] = 25;
   20             // set RSS maximum days to 7
   21             selectedList.RootFolder.Properties["vti_rss_DayLimit"] = 7;
   23             // commit the changes to the list
   24             selectedList.RootFolder.Update();
   25         }

See you later



  1. For the changes to stick, I had to also call Update() on the list after calling it on the RootFolder object...

  2. For me works with the only call made to the update of the rootfolder.

    Great article for managing rss feeds programmatically. Thanks man.

  3. Thank you Edge. Your post is of great help.

    Best Regards,

  4. thank you.. i was looking for this everywhere..

    thanks again..!!

  5. Thanks for your nice post. I am having problem on accessing list rootfolder properties in sharepoint 2010. I didn't find properties related to rss like 'vti_rss..' in sharepoint 2010. How can I set rss settings programatically in sharepoint 2010.

  6. Hi!
    thanks for your nice post.
    For the newly created list , properties like "vti_rss-.." will not be there so, for this i did EnsureRssSettings(). This works to me. but for properties "vti_rss_DocumentAsEnclosure" and "vti_rss_DocumentAsLink" its not working. do you have any idea, how to set that for newly created list ?

  7. FYI Some guy named Pube Hat posted your article as his own.