SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rel="canonical" Question?

    Hi Everyone,

    I was wondering if I'm writing my canonical URL links correctly?

    My canonical URL link
    <a link rel="canonical" href ='/dealers/Alabama'>Alabama</a>

    Below is the way google displays it on their website.
    <link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish"/>

    Notice mine above has the a at the beginning and end. Does this make much of a difference? Will google not know it's my canonical URL because of the added a at the beginning and end of the URL link?

    Thanks Everyone.

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,203
    Mentioned
    106 Post(s)
    Tagged
    1 Thread(s)
    Yes, it makes a difference. You want to use the <link format as that is the valid header format. <a is a completely different element, and should be used inside the body of a page to link from one page to another. The link you're looking for is used in the header to tell google, hey, this page needs to be accounted for as well.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  3. #3
    SitePoint Addict bronze trophy
    Join Date
    Mar 2013
    Location
    Oneonta, NY
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Scm,

    Your syntax is all wrong. Per Dave, you should be using <link> and not an <a> tag.

    Also, you have anchor text in your link. This link isn’t the same as a hyperlink that is embedded in the copy of a website. It will not be visible to users but is supposed to instruct search engines on which page is the correct one to index. Also, you need to have the absolute path of the page and not just the URI.

    Here is what it should look like,

    <link rel=”canonical” href=http://www.example.com />

    Best,

    Shawn

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys for your help!


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
  •