What is the correct code to write the rel=canonical in the HTML HEAD of the page?
-
is it like:
html>
<head>
<link rel="canonical" href="http://example.com/" />
head>
<body>
...<ref>sdfdfref>
or like:
-
Yes, it's correct!
-
Hi there,
In the first example, there is a mistake: the ending sign finish like this ' /> ' and it should finish like any other tag in HTML: like this ' > ' (in both, without the ' ' )
And what Chris says is right, the first points to the homepage and the second one to a specific page.
Best Luck.
GR. -
The first example would be the correct way to apply the code to your homepage. The second example you would want to apply to a specific page that the /wordpress/seo-plugin directs to. Just keep in mind that most of your pages are going to have a unique canonical tag, which can become overwhelming to apply manually. I see you referenced WordPress above, if your site is being hosted on WordPress, I would recommend installing the Yoast plug-in. Yoast will take care of all canonicals for you.
Hope this helps!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
What is the best use of canonical ref on home (default/index) page?
Moz reports show duplicate content for my www.domain.com and www.domain.com/default.html How do I format the canonical ref to put on the default.html page?
On-Page Optimization | | bhsiao0 -
Duplicate Page Content
Hey Moz Community, Newbie here. On my second week of Moz and I love it but have a couple questions regarding crawl errors. I have two questions: 1. I have a few pages with duplicate content but it say 0 duplicate URL's. How do I know what is duplicated in this instance? 2. I'm not sure if anyone here is familiar with an IDX for a real estate website. But I have this setup on my site and it seems as though all the links it generates for different homes for sale show up as duplicate pages. For instance, http://www.handyrealtysa.com/idx/mls...tonio_tx_78258 is listed as having duplicate page content compared with 7 duplicate URLS: http://www.handyrealtysa.com/idx/mls...tonio_tx_78247
On-Page Optimization | | HandyRealtySA
http://www.handyrealtysa.com/idx/mls...tonio_tx_78253
http://www.handyrealtysa.com/idx/mls...tonio_tx_78245
http://www.handyrealtysa.com/idx/mls...tonio_tx_78261
http://www.handyrealtysa.com/idx/mls...tonio_tx_78258
http://www.handyrealtysa.com/idx/mls...tonio_tx_78260
http://www.handyrealtysa.com/idx/mls...tonio_tx_78260 I've attached a screenshot that shows 2 of the pages that state duplicate page content but have 0 duplicate URLs. Also you can see somewhat about the idx duplicate pages. rel="canonical" is functioning on these pages, or so it seems when I view the source code from the page. Any help is greatly appreciated. skitch.png0 -
Do pages with fewer headings rank higher?
I've found several good quality, high ranking pages with excellent content, 500 to 1000 words. These pages are made by people who obviously know what they're doing. These pages only have one headline the h1 at the top of the page. Some of the sites use CSS div boxes and other things to make text look like a heading but do not have h2 or h3 tags or bigger font size. Could it be that a single headline tells Google that this page is about a single topic and that several sub headings muddy the water and so reduce page rank. Do multiple headings or subheadings affect page rank or is it just a personal style choice?
On-Page Optimization | | PhilipGledhill0 -
"On Page" report says 2 rel canonical urls-how do I fix that?
I am reviewing my On Page scores and I'm not getting a perfect score bk of this notice: No More Than One Canonical URL Tag Moderate fix <dl> <dt>Number of Canonical tags</dt> <dd>2</dd> <dt>Explanation</dt> <dd>The canonical URL tag is meant to be employed only a single time on an individual URL (much like the title element or meta description). To ensure the search engines properly parse the canonical source, employ only a single version of this tag.</dd> <dt>Recommendation</dt> <dd>Remove all but a single canonical URL tag</dd> <dd>HOW do I fix that?</dd> <dd>I am using Platinum seo plugin which I have checked "Use canonical urls" and the page in question is</dd> <dd>http://adderalldosage.net/general-adderall-dosage/</dd> </dl>
On-Page Optimization | | ccare7230 -
Rel canonical Issue
I have a huge rel canonical issue showing up on my website, and I'm not sure that I fully understand why. To my knowledge, this is something that comes about when alternate urls are used to link to the same page. However, this is not a technique that I've used with my website, yet it's still raising a flag on just about every page. http://bit.ly/jYyTYN Can anyone enlighten me on what's causing this? Thanks
On-Page Optimization | | JayAdams320 -
Is there a SEO penalty for multi links on same page going to same destination page?
Hi, Just a quick note. I hope you are able to assist. To cut a long story short, on the page below http://www.bookbluemountains.com.au/ -> Features Specials & Packages (middle column) we have 3 links per special going to the same page.
On-Page Optimization | | daveupton
1. Header is linked
2. Click on image link - currently with a no follow
3. 'More info' under the description paragraph is linked too - currently with a no follow Two arguments are as follows:
1. The reason we do not follow all 3 links is to reduce too many links which may appear spammy to Google. 2. Counter argument:
The point above has some validity, However, using no follow is basically telling the search engines that the webmaster “does not trust or doesn’t take responsibility” for what is behind the link, something you don’t want to do within your own website. There is no penalty as such for having too many links, the search engines will generally not worry after a certain number.. nothing that would concern this business though. I would suggest changing the no follow links a.s.a.p. Could you please advise thoughts. Many thanks Dave Upton [long signature removed by staff]0 -
Https and secure pages
Hello, I have a facebook badge in my footer. Is it okay if I make the code call on https. It makes the page secure for IE. I have also have done this for images. These secure urls are also being called on non secure pages. But I don't think that matters does it? Code below. Thanks Tyler
On-Page Optimization | | tylerfraser0 -
Cross-domain canonical
HI, We've got a German e-commerce site on an .at domain and would like to have a copy on a .de domain as we expect higher conversions for German users there. The idea now would be to make use of the cross-domain canonical tag, create a "duplicate" on the .de domain and add a canonical tag on all sites and refer to the original content on the .at domain. That would mean the .de won't rank, but German users could see the .de domain, Austrian users the .at domain in the address bar and everybody could feel "at home" ... that's the theory. What do you guys think? Valid strategy?
On-Page Optimization | | gmellak0