Site icon PrestaShop | General Knowledge

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:

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:

/t-shirt.html

✅ Method 4: Use Module (No Coding)

Search modules like:

(Some are paid but easier)


💡 Recommended Approach

👉 Best balance:

👉 If you want ultra-clean URLs:


 

Exit mobile version