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

Sitecore Technical Architect

Bhavik Patel is a certified Sitecore developer who has held Sitecore Most Valuable Professional (MVP) status since 2015. He has more than a decade of experience with enterprise-class Sitecore and Microsoft .NET framework development, including Sitecore integration with SharePoint and Business Intelligence solutions. He leads our Sitecore development practice, engineering enterprise-class Sitecore implementations for Government and commercial sector clients. He's an expert at using Sitecore Helix Framework to create re-usable architectures, streamline the integration of front-end development and provide the foundation for SEO-optimized Sitecore marketing websites.

Explore topics:

Other Blog Posts from Bhavik Patel