PrestaShop Documentation, PrestaShop Tutorials

Prestashop how to hide product attributes values in the URL

In PrestaShop, product attribute values (like size, color) appear in the URL mainly due to the combination system + SEO-friendly URLs.

Example:

/t-shirt.html#/1-size-s/2-color-blue

If you want to hide attribute values from the URL, here are the practical ways:


✅ Method 1: Disable “Anchor” in URLs (Quick & Safe)

Steps:

  1. Go to Shop Parameters → Traffic & SEO
  2. Find:
    “Set shop URL” or “Schema of URLs”
  3. Keep friendly URL ON but:

👉 This alone won’t fully remove attributes, but reduces SEO exposure.


✅ Method 2: Modify Product URL Structure (Best Clean Method)

Steps:

  1. Go to:
    Shop Parameters → Traffic & SEO → SEO & URLs
  2. Edit:
    Route to products

Default:

{category:/}{id}-{rewrite}{-:ean13}.html

✔ Keep it like this (DO NOT include attributes)


⚠️ Important:

PrestaShop adds attributes using URL fragments (#/…), not actual URL paths.

Example:

#/1-size-s

👉 These:

  • Are NOT indexed by Google
  • Do NOT affect SEO
  • Are used only for JavaScript switching

So technically, they are already “hidden” from search engines.


✅ Method 3: Remove Attributes from URL Completely (Advanced – Code)

If you want FULL removal (no #/…), you need override:

File:

/themes/your-theme/assets/js/theme.js

OR

/themes/your-theme/_dev/js/product.js

Find function:

updateURL()

Remove or comment:

window.location.hash = ...

⚠️ Result:

  • URL will stay clean:
/t-shirt.html
  • But:
    ❗ Back/forward browser may not track combinations
    ❗ Shareable combination links won’t work

✅ Method 4: Use Module (No Coding)

Search modules like:

  • “Clean URL”
  • “Remove attribute from URL”

(Some are paid but easier)


💡 Recommended Approach

👉 Best balance:

  • Keep default (# attributes)
  • Don’t worry about SEO impact

👉 If you want ultra-clean URLs:

  • Use Method 3 (JS override)

 

About zohaibk

We develop useful addons for #E-Commerce and #CRM software to provide extra features.#PrestaShop,#Magento,#SugarCRM,#Vtiger & #Android #apps
View all posts by zohaibk →