Because Sitecore is a CMS that supports multiple languages, you may often notice that links generated from code have the language specified in the link (for example, ‘en’). If you don’t want the language embedded in generated links, you can disable that option in the following section of Sitecore’s web.config:

<linkManager defaultProvider="sitecore">
    <clear />
    <add name="sitecore" type="Sitecore.Links.LinkProvider,
    Sitecore.Kernel" addAspxExtension="true"
    alwaysIncludeServerUrl="false" encodeNames="true"
    languageLocation="filePath" lowercaseUrls="false"
    shortenUrls="true" useDisplayName="false" />

For your reference, the languageEmbedding options are:

  • asNeeded (default)
  • always
  • never