Let’s say you have an online store with 5 categories, 3 subcategories each, and 10 products in each subcategory. How to make the URLs?
You have the following options:
- site.com/product-page-url
- site.com/category/product-page-url
- site.com/sub-category/product-page-url
- site.com/category/sub-category/product-page-url
There’s also a mixed option, in which the product page looks like this:
- site.com/product-page-url
, while the categories look like this:
- site.com/category/
- site.com/category/sub-category/
(in this scenario, things are mixed – the product page has no hierarchy, while the category page has one).
In each of these options, the URL can contain the full title of the product or category, or they can be abbreviated. For example, if you sell air conditioning equipment, you could have any of the following:
- site.com/air-conditioning-equipement/manufacturer-toshiba/toshiba-air-conditnioning-9000-btu-led-display-tos47838389 (notice the long path), or:
- site.com/air-conditioning/toshiba/tos47838389 (notice the abbreviated names)
So, what to choose? Should you use subfolders (/category or /sub-category or /category/sub-category), or should you directly link to products? Also, should you use abbreviated names or long names?
First, let’s see how Matt Cutts from Google sees things:
- The Short SEO Cutts: Does the number of subdirectories in a URL affect its ranking?: “Virtually no difference”
- The Short SEO Cutts: How does URL structure affect PageRank?: “It doesn’t really matter what your URL structure is”
- The Short SEO Cutts: Does the position of keywords in the URL affect ranking?: “Don’t worry about it, but keyword in the URL helps a little bit”
About Matt Cutts:
“For me, the most interesting was the following statement he made:“I wouldn’t bother with year/month/day in blog urls; I’d just use the first few words from the title of the post in the url.”
In the comments, Matt says the dates are “useless cruft to me as a user”, which could indicate he simply dislikes them from a usability standpoint.
However, my read was that he was implying that Google prefers a flat directory structure – that it’s not the date in itself that’s the problem, but rather it’s that fact that each date segment adds another directory level.”
So, what’s the solution?
There’s not a definite answer, but my suggestion is to have this structure:
- site.com/product-page-url
- site.com/category
- site.com/sub-category
, and also to minimize the length of the URL as much as possible. keep it as short as possible.
Below, I’ll give some pros / cons of using this structure, and argument my position.
Pros for a flat-hierarchy for URLs (use site.com/product-page-url):
- Big impact – Usability, which might lead to people wanting to click more often on link and also making people link to your site. See the blog posts URL on Derek Sivers’ blog. They’re all very short & sweet. Who wouldn’t link to them? (examples: http://sivers.org/mindset, http://sivers.org/cs, http://sivers.org/full etc.)
- Big impact – It’s easier to transmit a URL via phone if it’s a small one. It’s also easier to remember it and to write it down. It’s also easier to just look at the address bar in the browser and have an idea on what the page is about.
- Small to medium impact – If you plan to change the CMS platform, it’s generally easier to migrate a flat-style architecture web site than a site with subfolders (but, on the other hand, you can still do this, and CMS changes happen rarely).
- No impact – generally, URL length in itself is not an issue. Very long URLs are generally OK for most browsers, so this is not a worry to me.
- No impact – I don’t agree with URL density, see Matt Cutts quote above. So, I don’t necessarily think that this URL:
- site.com/air-conditioning-equipement/manufacturer-toshiba/9000-btu-led-display-tos47838389 (notice the long path and low keyword density for “air conditioning toshiba”), is better or worse for SEO purposes, than this URL:
- site.com/air-conditioning/toshiba/tos47838389 (notice the abbreviated names, high keyword desnity for “air conditioning toshiba”).
Tip: don’t make it excessively short. In my opinion, Derek Sivers’ URLs are a bit excessively small. I would keep the URLs to 2-4 keywords. You should be able to understand the topic of the message from the URL, and yet have a short one in the same time.
Cons for a flat-hierarchy for URLs, and instead opting for a hierarchical tree structure (use site.com/category/sub-category/product-page-url):
- Medium impact – Depending on what business you’re in it, it might make sense to use a hierarchical structure, from an usability point of view. For example, if you sell IT, some people prefer to know if a hard-drive is an internal one, an external one, a hard drive to be used for laptops, a hybrid drive (both SSD and “classical”) and so on. You could make it very clear right from the URL.
- Small to medium impact – Google might be able to crawl your web site better, as long as in the folder /category or in folder category/sub-category you have a listing of other URLs. So, in the /category folder you should have a listing of the subcategories, and in the /category/sub-category you should have a listing of all the products.
- Very small impact – It might be easier for you to interpret Google Analytics statistics if you know that product X is category Y.
In my opinion, the mixed scenario I presented at the beginning:
There’s also a mixed option, in which the product page looks like this:
- site.com/product-page-url
, while the categories look like this:
- site.com/category/
- site.com/category/sub-category/
(in this scenario, things are mixed – the product page has no hierarchy, while the category page has one).
is a very poor solution, and I’d just ignore using it. To me, it’s very confusing, and it brings little to no advantages.
It’s the worst of two worlds. It’s both confusing for the users, and, in my opinion, for the engines. Avoid it.
Should you rewrite your URLs based on what I wrote here?
This question in itself requires some additional information:
- How many links to your internal URL have (have lots of people put links to your internal pages, and now you will need to redirect those URLs)? (If you have lots of links, the impact on your site will be bigger, at least for a few months)
- How big is the transformation? If you have very big URLs and you switch to very small URLs, you will see, probably, some good effects from usability (people will tend to link to your site more). But if you switch from already small to even smaller URLs, the impact might be small enough that it’s not worth doing.
- Depending on your niche, a hierarchical structure might make your URLs more usable than flat-style URLs.
- Finally, you should balance the advantages with disadvantages. You will lose some traffic/positioning in Google when you redirect from old to new URLs and the benefits might be small. There are no exact numbers, but you should weigh the arguments well prior to taking a decision.
Some good articles on the subject of URL structure:
- URL Structure: The Closer to the Root – the Better? – Search Engine Journal
- SEO – 3 Reasons to Always Have Structured URLs – Bruce Clay
- Blog Optimization and the Flat Directory Structure
- seo – Flat vs. Hierarchical Tree Structure – Webmasters Stack Exchange
- SEO Cheat Sheet: Anatomy of A URL – Moz
- The Short SEO Cutts: Do you have any specific tips for news sites?: “Try to keep the same story on a single URL as it evolves”
If you plan to redirect URLs by changing the structure, you might want to read:
- Redirection – SEO Best Practices – Moz
- 10 Traffic Graphs from the SEOmoz to Moz Domain Migration – Rand’s Blog
- Web Site Migration Guide – Tips For SEOs – Moz
- Domain Migrations: Surviving the “Perfect Storm” of Site Changes – Moz
You might also be interested in:
You are offering this urls structure:
site.com/product-page-url
site.com/category
site.com/sub-category
When we coding, how can we distinguish products and categories ? For example; I am storing product page urls in “products” table, and storing category urls in “categories” table in database. When the request come, how can I know that which table I should look ? Maybe we should use like that: https://olivian.ro/category/strategy/
Hi, Deniz,
I would do it like this:
1. Consider that “product-page-url” is a slug.
2. Have all products / categories / subcategorie take one slug, different from all the previous ones.
3. Identify the product/category/sub-category by slug.
4. Once identified, get the type of that item (product/category/sub-category).
Voila! :)
Now what happens if you have the same product in multiple categories?
Consider
“shop/dresses/red-desses/awsome-dress”
“shop/dresses/button-dresses/awsome-dress”
Now you have duplicate content.
Maybe it would be better to have your categories,
“shop/dresses/red-desses”
“shop/dresses/button-dresses”
The. Once a product is clicked it takes you to:
“shop/product/awsome-dress”
Or, maybe each product hasa “default” category, so if you click on awsome-dress inside of “red-desses”, it sends you to “button-dresses” because it had been set as the “default” category.
What’s best?
I think there are some e-commerce platforms which have the issue which you describe here.
I would consider for this just adding rel=canonical to the duplicate problem, it might be an easy fix.
Or, don’t produce duplicate content in the first place, by avoiding to have the same product in different categories …
Let me know if I haven’t replied with what you needed.