Disable Language Embedding in URLs and Sitecore Links

We know that Sitecore is a CMS and it supports multiple languages, hence the generated URL and Sitecore links will have a language appended to it for example(‘en’,’en-US’, etc.,). In this article, we will see How to Disable Language Embedding in URLs and Sitecore Links.

Most of the settings of Sitecore can be done without writing any additional code. We can easily disable language embedding in Sitecore by editing web.config’s <linkManager> section where the languageEmbedding option can be configured.

<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

Changing the config to use languageEmbedding="never" will stop the language from showing up in the URL, and likewise languageEmbedding="always" will force the language to always show up in the URL.

Note: Do not use the option “asNeeded” unless you are sure about what you are doing, as it might cause multiple URL’s for the same pages and this might affect the SEO of the site. Use either “never” or “always” which is much more SEO-friendly.

Leave a Reply

Your email address will not be published.

Sign Up for Our Newsletters

Get notified of the best deals on our WordPress themes.

You May Also Like
How To Get File Size In Python

How to Get File Size in Python?

Table of Contents Hide Python get file sizeMethod 1: Get file size using os.path.getsize()Method 2: Get file size using os.stat()Method 3: Get file size using seek() and tell()Method 4: Get…
View Post

How to Comment in PowerShell Script

Table of Contents Hide Single Line Comment in PowerShellMultiLine Comments in PowerShellSyntax for  Comment Based Help in FunctionsSyntax for Comment-Based Help in Scripts Like any other programming language, PowerShell also…
View Post