Disable Language Embed in Sitecore Links

Bhavik Patel • 11/14/2014

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">
  <providers>
    <clear />
    <add name="sitecore" type="Sitecore.Links.LinkProvider,
    Sitecore.Kernel" addAspxExtension="true"
    alwaysIncludeServerUrl="false" encodeNames="true"
    languageEmbedding="never"
    languageLocation="filePath" lowercaseUrls="false"
    shortenUrls="true" useDisplayName="false" />
  </providers>
</linkManager>

For your reference, the languageEmbedding options are:

  • asNeeded (default)
  • always
  • never

Bhavik Patel

Bhavik is a .NET developer with over 9 years of experience, focusing on Sitecore CMS for the last 3 years. He has worked on several Sitecore CMS projects in both single-site and multi-site scenarios, and truly enjoys how extensible it is. He has a passion for problem solving and using technology to create engaging websites and applications. Bhavik is a Sitecore Technology MVP, 2015 and 2016.

Explore topics:

Other Blog Posts from Bhavik Patel



Subscribe for insights, trends and big ideas