SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Canonical links

  1. #1
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)

    Canonical links

    I've recently finished a site, and have been asked to add canonical links to the top of each page. I admit I've never looked into these before.

    The site runs on a CMS that has very clean links—there's only ever one URL version. No session IDs, query strings etc. Except that the index page of each section could be called clientsite.com or clientsite.com/index... etc, but I can fix that with a few redirects. I also redirect the non www to the www version.

    SO... is there any point in canonical links for this site? According to the video I linked to above, there is the possibility that external links to the site might be a problem. Such as someone placing a link online with some upper case letters instead of the normal lower case... and I'm not sure how shortened links such as tinyurls (used by social media &co.) might affect things.

    Any thoughts?

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I am assuming this is purely for the sake of Google since it is using propriety markup values - if I had a faster connection I've view the video but don't so haven't.

    Yes, I think they are probably just overkill if by what you are saying everything else is clean and logical.

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Thanks for the reply. The info in the video is basically repeated on the page. Apparently this proprietary code is supported by each of the major search engines, if not others as well.

    To add canonical links to each page I'd have to use a plugin for the CMS, so I'd like to know there's a realistic purpose for it before I delve into all that. I asked this in the HTML forum rather than the SEO forum, as it's really a question about duplicate link than the canonical links themselves. Is there really a problem is a page can be accessed as mysite.com/section and mysite.com/Section?

    I assume it's analogous to the argument for redirecting //www.domain to //domain (or vice versa).

  4. #4
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,828
    Mentioned
    110 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    I've recently finished a site, and have been asked to add canonical links to the top of each page. I admit I've never looked into these before.

    The site runs on a CMS that has very clean links—there's only ever one URL version. No session IDs, query strings etc. Except that the index page of each section could be called clientsite.com or clientsite.com/index... etc, but I can fix that with a few redirects. I also redirect the non www to the www version.

    SO... is there any point in canonical links for this site? According to the video I linked to above, there is the possibility that external links to the site might be a problem. Such as someone placing a link online with some upper case letters instead of the normal lower case... and I'm not sure how shortened links such as tinyurls (used by social media &co.) might affect things.
    Canonical links are most useful when you have multiple variations on a URL. Essentially, I would say that any time when you have a 301 in place - whether it's to add/remove the www., because a page has moved, or through a URL shortening service - it isn't necessary to use canonical links.

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Thanks Stevie D. I did a little test, replacing the odd character in a url with a capital letter, and was surprised to see that the page appeared anyway. Started to wonder if such a url would be indexed separately if someone placed a link to it online somewhere.

    I take your point that shortened urls are essentially straightforward redirects (or that's what I thought you were saying ).

  6. #6
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Actually, there is another useful reason to have properly addressed URL's (beyond SEO) and that is usability. Surprisingly there are still people who insist on entering URL's manually into the address bar (I know, crazy!), for those average people who want to access a page that the address is written (say) on a piece of paper, being able to commit the URL to memory or being able to easy re-enter the text without having to remember dots and underscores and stuff like html or php is MUCH easier for the end user. It seems to be an issue quite often, especially when URL's are mentioned on TV or radio or other analog mediums which don't support clicking.

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    If the page url is mysite.com/section but they type in mysite.com/Section, they will still get to the page. But if they were to post a link on their blog to mysite.com/Section, I'm wondering if Google would index that as a different page from mysite.com/section.

  8. #8
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function canonical_for_comments() {
    global $cpage, $post;
    if ( $cpage > 1 ) :
    echo "\n";
    echo "<link rel='canonical' href='";
    echo get_permalink( $post->ID );
    echo "' />\n";
    endif;
    }
    add_action( 'wp_head', 'canonical_for_comments' );

    <snip />
    Last edited by SpacePhoenix; Oct 22, 2010 at 00:47. Reason: removed fake signature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •