大网数据广告活动
网站运营与故障问答

Facet filters URL structure for ecommerce site for SEO

· 52CE 我爱测

I am working on implementing facet filter for e-commerce site and I am not sure which schema of URL structuring is better for SEO purposes. There are three options I have in considerations as of now, and and I need some help to u…

问题原文

原帖链接 · Krunal · CC BY-SA 4.0

I am working on implementing facet filter for e-commerce site and I am not sure which schema of URL structuring is better for SEO purposes. There are three options I have in considerations as of now, and and I need some help to understand which is better for SEO & considered as best & standard practices.

Option A

example.com/apparel?price=0-2000&color=red&size=medium&size=large&category=jeans&rating=4-5

All facet parameters separated by & and as key=value.

Option B

example.com/apparel?price=0-2000&color=red&size=medium,large&category=jeans&rating=4-5

Like above, but with multiple values in same facet option separated by comma.

Option C

example.com/apparel?specs=color:red||size:medium||size:large&price=0-2000&category=jeans&rating=4-5

Parameters which are fixed like price, rating, category are separated like above and all are grouped in spec parameter with options separated inside spec using double pipe.

Update The question is not about what character to use but the structure of URL. Lets assume I will replace unsafe characters with safe characters, then then what structure do you recommend?

There is a difference in URL structure, like A has everything as key=value pair, while B has key=value1,value2 (two values in single key), and C has a grouping like specs=key:value|anotherkey=value.

Now, as the facetname is going to be dynamic and there could be thousands of them, I can not block them using robots or URL parameters like described here: https://stackoverflow.com/questions/9149782/ignore-urls-in-robot-txt-with-specific-parameters. I believe this is required for preventing duplicate contents issue.

If I use option C, this becomes easy as there are few facet groups only that can be easily configured compared to having direct facetname=value in URL.

What do you recommend.

已采纳解答

原帖链接 · Prinny · CC BY-SA 4.0

First of all, let me open by saying I personally answered your last question and my proposal was option A. Since I stated my thoughts regarding option A, I will just say why options B and C are no good.

Option B uses comma as delimiters for range. Comma is an unsafe character, meaning it will be encoded to %2C in your url and will generally seem like gibberish (definitely not SEO friendly URL).

At the same time, its designated purpose in URLs is to be used for large numbers to seperate their magnitudes (like 9,999) so option B does not refer to that case.

Option C uses | and as seen in the rfc1738 I also linked in my previous answer:

Other characters are unsafe because
gateways and other transport agents are known to sometimes modify
such characters. These characters are "{", "}", "|", "\", "^", "~",
"[", "]", and "`".

So among those 3 options, the first one is the only that adheres to the specifications and best practices.

UPDATE

If your concern is a huge number of multifaceted URLs that correspond to the same content, grouping them in the URL is not the way to go. Use canonical tags or parameter-sort your URLs to ensure you get don't spill ranking across different pages for the same content. This is the way to handle duplicate content.

Even then, you can opt to block the faceted pages in your robots.txt. Just make your faceted pages start with /search, so for example

example.com/apparel?price=0-2000&color=red&size=medium&size=large&category=jeans&rating=4-5

becomes

example.com/apparel/search?price=0-2000&color=red&size=medium&size=large&category=jeans&rating=4-5

and in your robots.txt

Disallow: /*search?*

I still believe that the facetName=facetValue1-facetValue2 is the best format as it is easy to read by the user. This is however my personal opinion and I would love to hear some other people's inputs on the matter.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-01-27)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。