How To Add Custom Settings / App Settings In Sitecore

When building a website you will inevitably need to store configuration data somewhere. In today's post, I'm going to cover the options available to you when you use Sitecore.


As Sitecore is a .NET application you can always use the app settings section in your web.config.
    <add key="SettingName" value="true" />
Which you can then access in code like this:
var value = ConfigurationManager.AppSettings["SettingName"];
It's generally advised to try and keep your web.config as mean and lean as possible. If you want to upgrade your Sitecore, then you have to merge manually your web.config.

SiteCore Setting

Sitecore also provides an easy API to write your own APP settings file. This can be really useful if you want to deploy your site in different environments. To create your own Sitecore App settings file, first, create a new file in \App_Config\Include. You can call it whatever you like. I normally use ProjectName.Settings.config. In the file you can add in custom settings by using the following convention:
<configuration xmlns:patch="" xmlns:set="">
      <setting name="SettingName" value="true"/>

We can access these settings like this:
    var value = Sitecore.Configuration.Settings.GetSetting("SettingName")
If you have any issue with your settings, you can always check Make sure the Sitecore config page to make sure Sitecore knows about your setting. To access use the following in your web browser, If you want to you can also use the Sitecore API to get access to normal App settings by using the following snippet:

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

Back to top
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-35662136-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + ''; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();