Monday, July 7, 2025

🚀 Sitecore 10.4 SXA Upgrade: Language Embedding Issue & Temporary Workaround

Hi everyone! 👋

We recently upgraded our Sitecore platform from version 10.1 to 10.4, along with the SXA module. While the overall upgrade process was largely seamless — thanks to Sitecore’s detailed documentation — we did run into a few unexpected challenges that I believe are worth highlighting. This post is especially for those planning a similar upgrade journey.

If you’re just starting out, I recommend reviewing my earlier blogs where I outline key upgrade steps and best practices. For now, let’s focus on one specific post-upgrade issue we encountered: language embedding in URLs not functioning as expected.

🧩 The Issue: Language Embedding Not Working Properly

Our SXA-based websites rely on language embedding to ensure that URLs include the language code, such as:

https://hostname/en-CA/medical

However, post-upgrade we observed two key problems:

  • The language prefix was not applied at the hostname root.
  • While language switching on the website technically worked, the URL did not reflect the language change, leading to user confusion.

Initially, we suspected a bug in our custom implementation. But after deep investigation and coordination with Sitecore Support, it was confirmed to be a product-level issue. (Reference: Case #CS0585903, awaiting official confirmation.)

The root cause was traced to the SwitchableLinkProvider, which wasn’t honoring the Language Embedding checkbox in the SXA settings. Sitecore acknowledged the issue and has scheduled a fix under reference SXA-8360.

🛠 Temporary Fix: Custom Link Provider Implementation

While waiting for the official hotfix, we needed an immediate workaround due to our reliance on this feature across multiple sites.

Here’s the temporary solution we implemented:

  • We configured a custom link provider to replace the default SwitchableLinkProvider.
  • A simple patch config was added.
  • In the SXA Site Grouping settings, we explicitly set the Link Provider name to use our custom provider.

This resolved the language embedding issue across all URLs.

Patch Example:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
   <sitecore>
      <linkManager defaultProvider="switchableLinkProvider" >
         <providers>
            <add name="CustomLinkProvider" type="Sitecore.XA.Foundation.Multisite.LinkManagers.LocalizableLinkProvider, Sitecore.XA.Foundation.Multisite" lowercaseUrls="true" languageEmbedding="always" addAspxExtension="false" />
         </providers>
      </linkManager>
   </sitecore>
</configuration>

⚠️ Note: This is a temporary workaround. We’re still awaiting the official Sitecore patch and will share updates once it’s available.

💬 Final Thoughts

Upgrading to newer Sitecore versions — especially when SXA is involved — can surface subtle yet impactful issues. The important takeaway:

  • Stay proactive,
  • Don’t hesitate to involve Sitecore Support, and
  • Be open to temporary creative workarounds when business continuity is on the line.

💡 “There are many solutions to a problem. The challenge is identifying the right one at the right time.”

Happy coding! 🔧
 Have you encountered similar issues during your upgrade? I’d love to hear your experiences and solutions in the comments.

I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.