Question

FOR SEARCH ENGINE OPTIMIZATION PURPOSES, does the location of the slug within a URL matter?

There's no doubt that you could code URL slugs to work properly in any order. I'm more interested to know if search engines place different weights to portions of the URL on the right-hand-side vs the left-hand-side

For example, here the slug appears at the end of the URL: Why do some websites add "Slugs" to the end of URLs?

Whereas here the slug appears in the middle of the URL: https://stackoverflow.com/questions/why-do-some-websites-add-slugs-to-the-end-of-urls/47427

Was it helpful?

Solution

Unfortunately, given Google's (and most other search engine's) security through obscurity (fear of gaming of the system if any clear methods are described/explained), there's just not going to be a clear, demonstrable answer.

On the whole, you can assume that if it seems slimy, Google will penalize it, and if it seems semantic/useful, Google will promote it. In the case of the above url, it's my guess that Google will treat both the same, but that's entirely a guess, and outside of a Google algorithmic engineer stopping in here, I doubt you're going to find anything more definitive.

OTHER TIPS

It's better to push whatever has less semantic content to the right because it's more likely to get chopped off by length limits on what's considered relevant. So the second form you post would be better for SEO purposes than the way SO does it. (Better yet is using the slug as a real identifier and keeping semantic-content-free IDs out of it.)

I always go with the Rule that it is important to move from right to left when determining the most important information in your URL for the user (an actual user or google). So the question you have to ask your self, is do you want your user to see the ID or the title as the most important thing of the page.

Also what happens if they drop off the number, and just leave the title. The page blows up right, but what happens if you drop the slug and leave the number. The page functions as normal.

Parsing the URL is probably a lot easier if the slug is at the end. You can pull out the values you need from the beginning of the path, and then just ignore everything after it. (so the slug could be even more complex than what you have, with multiple "directories", etc). If you put the slug at the beginning or the middle you have to be able to parse that out in order to find what's important.

https://stackoverflow.com/questions/727281/blahblablah-lets-assume-that-this-continues-on-and-on-and-on

Now if you truncate that https://stackoverflow.com/questions/727281/blahbla still works.

In the other case: https://stackoverflow.com/questions/why-do-some-websites-add-slugs-to-the-end-of-urls/47427 truncated https://stackoverflow.com/questions/why-do-so would have no chance to work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top