Shopify removes   from the product description

Topic summary

Issue: Shopify’s product description editor automatically removes non-breaking space entities ( ) when users switch between code and preview modes, even though these are intentionally placed (e.g., between numbers and units like “10 bar”).

Explanations provided:

  • This is intentional behavior, not a bug
  • Shopify’s Liquid templating engine escapes special characters by design
  • Theme code may include escape string handlers that strip these entities

Suggested workarounds:

  • Use CSS properties like white-space: nowrap; for layout control
  • Apply JSON filters with string replacement in Liquid code (example provided using | json | replace filters)

Status: The original poster reported the issue resolved temporarily on its own, though another user later requested clarification on implementing the solutions, indicating the problem persists for some users.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Hi :victory_hand:

Just use a JSON filter and then replace the string with the correct view. Example:

{%- liquid
  echo "10 bar" | json | replace: '\u0026nbsp;', ' ' | replace: '\u003c', '<' | replace: '\u003e', '>'
-%}