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?
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.
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 />
Thanks guys for your help!
This topic is now closed. New replies are no longer allowed.