Does the position of a slug in a URL matter? [closed]
Asked Answered
A

5

11

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

Afternoons answered 7/4, 2009 at 19:37 Comment(0)
E
3

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.

Elah answered 2/6, 2009 at 15:11 Comment(0)
W
8

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.)

Wera answered 7/4, 2009 at 19:44 Comment(3)
I agree with this. If you remove the slug from SO links, it doesn't make a differencePentlandite
@alex, I think what @Wera is saying is to remove the numeric identifier if possible in favor of only using the slug in the URLAfternoons
People make mistakes. Sometimes they don't get the whole link. They can usually figure it out if they miss the beginning... but in this case, if they mess up the END and miss a number or add an extra one, the link is broken. having the "useless" slug at the end avoids this.Depilate
T
4

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.

Tennant answered 7/4, 2009 at 20:2 Comment(0)
E
3

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.

Elah answered 2/6, 2009 at 15:11 Comment(0)
M
2

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.

Motherofpearl answered 7/4, 2009 at 19:41 Comment(4)
What do you mean? Using the links in the question, the first one (slug at the end) works. The second gives me page not found errors. So it looks to me like on SO the slug has to be at the end.Motherofpearl
I'd disagree with this. Strings are usually parsed from left to right anyhow and people are more likely to add things to the end of a URL ( accidentally )Depilate
@Atomiton Right, it's parsed left-to-right and people might accidentally add stuff to the end, so wouldn't that suggest the slug (which isn't parsed or really important) should go at the end, as I said?Motherofpearl
Sorry. Must've had a momentary brain fart. What you wrote is what I was thinking... ( but I admit I had to re-read it thrice to see that )Depilate
A
2
https://mcmap.net/q/981402/-does-the-position-of-a-slug-in-a-url-matter-closed

Now if you truncate that https://mcmap.net/q/981402/-does-the-position-of-a-slug-in-a-url-matter-closed 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.

Avionics answered 7/4, 2009 at 19:58 Comment(2)
There's no doubt that you could code this to work properly in any order. I'm more interested to know if search engines place any different weight to portions of the URL on the right-hand-side vs the left-hand-sideAfternoons
i monitored many SERPs, and i really think that position of slug in URL is matter to SEO.Gloom

© 2022 - 2024 — McMap. All rights reserved.