Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Canonical URLs, keeping just the page id

         

thms

5:40 pm on Mar 18, 2015 (gmt 0)

10+ Year Member



Hi all,

Consider a URL structure like this


http://example.com/12345/keyword-rich-slug


Where '12345' is the page id. Now my system lets users change the title of the page, so eventually, the same URL above could be changed to something like this but still show the same content:


http://example.com/12345/keyword-rich-slug-edited


So the page id is still the same, with just a different slug.

Now I was wondering if declaring the canonical URL like this:


http://example.com/12345


This is the only thing that is needed for me to serve the right content and would be perfect and avoid having to change the canonical URL everytime the user changes the page title.

But the problem(or not) is that the canonical URL now doesn't include any 'keyword-rich-slug'. Will that have an impact on SEO for the site?

rainborick

6:48 pm on Mar 18, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you declare http://example.com/12345 as the canonical, you will lose any potential ranking value of the keywords in the remainder ("slug") of any other similar URLs because Google will (essentially) only index the canonical URL ending in your page ID number. If you want to include keywords in such URLs, pick one set and use that as the canonical.

phranque

7:46 pm on Mar 18, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



will the same content be served for any arbitrary keyword slug?

thms

7:48 pm on Mar 18, 2015 (gmt 0)

10+ Year Member



@phranque

yes, the slug could be anything.

phranque

8:01 pm on Mar 18, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



this means any url with a keyword slug in it is a noncanonical URL and should be redirected with a 301 status code to the URL without the keywords slug or trailing slash.
in addition, you should only link internally to canonical URLs.

lucy24

9:31 pm on Mar 18, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



my system lets users change the title of the page

Ambiguity alert! Is the part they're changing the page's title i.e. the bit in <title> tags? And then the URL is generated from that?

If
/12345 = /12345/any-old-garbage-here
then the last bit shouldn't even exist in the URL.

thms

9:38 pm on Mar 18, 2015 (gmt 0)

10+ Year Member



@lucy

yes, the URL slug is generated dynamically from the title.

I disagree that it shouldn't exist in the URL. Having 'any-old-garbage-here' in the URL helps several ways.

First, I think it makes users more inclined to click on the URL.

Second, it also helps me quickly know what the url is about, for example when I'm debugging something or just day to day managing of the site.

Third, several people agree that having the slug in URL helps a bit in ranking.

So I prefer to have 'any-old-garbage-here'

phranque

10:28 pm on Mar 18, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



in that case you should still not allow arbitrary keyword slugs.
you should link only to the canonical URL and serve content only to requests for the canonical URL.
any requests for previously used title slug URLs should be redirected to the canonical URL with a 301 status code.
any requests for URLs with arbitrary title slugs should get a 404 response.

phranque

10:30 pm on Mar 18, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



in addition the page ID only URLs should be redirected to the canonical URLs containing the title slug.

lucy24

3:46 am on Mar 19, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think it makes users more inclined to click on the URL.

? Under what circumstances does a user "click on" an URL? What they click on is the linking text, which is independent of the URL.

thms

4:37 am on Mar 19, 2015 (gmt 0)

10+ Year Member



Well sometimes the linking text is the URL itself, or in the case of search results, it's displayed next to the link.

So you don't think having a slug in the URL is important? Tell that to 90% of the first results in SERPs...

rainborick

5:08 am on Mar 19, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The issue isn't that keywords in the URL aren't beneficial. The issue is that your approach is, at best, impractical.

When the search engines discover identical content is accessible via multiple URLs, they automatically choose what they consider the best or "canonical" URL for the index. You can influence their choice of the canonical URL to a high degree either by using the rel="canonical" tag or by using a 301 redirect. But the ultimate result is the same - only one URL will ever appear in the search results. This is why I recommended that you pick one version of the URL. At least you get some choice.

Overall, I think this is a very bad idea. It has significant risks from several aspects of all of the search engines' ranking methods for very little advantage.