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
-
Understanding why our new page doesn't rank. Internal link structure to blame? + understand canonical pages more.
Hi guys. Sorry it's an essay...BUT, i think a lot of you will find this an interesting question. This question is in 2 (related) parts, and I imagine it would be an 'advanced' SEO question. Hoping you guys can help bring some real insight 🙂 Always amazed at the quality for this forum/ community. **Context... ** We had a duplicate content issue caused by this page and it's product permutations, so we placed canonical tags on all the product permutations to solve it. Worked a treat. However, we now have more **product ranges. **We now sell Diaries, Notebooks & Music books, which are clearly different from one another. So...we've placed canonical tags on all the product permutations leading back to the 'parent' theme. In other words, all the diary permutations 'lead back' to the diary page. All the notebooks permutations 'lead back' to the main notebook page. So on and so forth. Make sense so far? Context end..... Issue. Amazingly our Diary page outranks our notebook pagefor the search term 'Design your own Notebook'. The notebook page is well optimised for this search term, and the diary page avoids the word 'notebook' altogether (so no keyword cannibalisation going on). Possible reason? Our Diary page has a vast amount of internal links to it throughout our site. The notebook page has only a few. Could this be the issue? If so, what reading/ blogs/ content/ tools would you recommend to help understand and solve this problem? i.e) Better understanding internal link structure for SEO. 2nd part of the question (in the context of internal linking for SEO). When there are internal links to a page with a conical tag does that 'count' towards the 'parent page', or simply towards that specific page? I really hope that makes sense. If it's clear as mud just shout. Isaac. EDIT: All pages in question have been indexed since we added these changes to the site.
On-Page Optimization | | isaac6630 -
PAGE TİTLE
<title> </span>Home to home moving 4356 <span></title> page A <title> </span>Home to home moving 3723 <span></title> page B These two titles are the same?
On-Page Optimization | | iskq0 -
Conflicting Canonical Tag in On-Page Report
I'm going through my site with the "One-Page report card for some PPC landing pages. If I have this canonical tag on my page : I get a Fail in the "Critical Factors Section here: Appropriate Use of Rel Canonical but a Pass in the Optional Factors here: Canonical URL Tag Usage If I take the canonical link out, the opposite happens, what am I missing? Is the format wrong? Thanks Michael
On-Page Optimization | | mjrinvent0 -
What if Paginated Pages all have PageRank?
Paginated Pages, page 2,3,4 etc.... they aren't supposed to have a PageRank, right? If they are only linked to from themselves, only the original page, Page 1, is supposed to be showing PageRank? I'm trying to double check that I am handling this right. I'm not using canonical, or noindex or any of that... just using rel next and prev, which I thought would be fine. Thoughts?
On-Page Optimization | | MadeLoud0 -
Help I don't understand Rel Canonical
I'm really stuck on how to fix up Rel Canonical errors on a Wordpress site. I went in and changed all the URLs to remove the www and added / to the end. I get this message on page analysis details: <dt>Canonical URL</dt> <dd>"http://www.some-url.com.au/",</dd> <dd>"http://some-url..com.au/", and</dd> <dd>"http://some-url..com.au/"</dd> <dd>Well the first one with the www doesn't exists and the second two urls are the same! (Note that I have removed the actual URL for this post)</dd> <dd>I'm not sure how to read and fix the errors from the reports ether. The only issues I can see is that the 'Tag Value' has the www and the 'Page Title - URL' doesn't have the www.
On-Page Optimization | | zapprabbit
</dd>0 -
Missing meta descriptions on indexed pages, portfolio, tags, author and archive pages. I am using SEO all in one, any advice?
I am having a few problems that I can't seem to work out.....I am fairly new to this and can't seem to work out the following: Any help would be greatly appreciated 🙂 1. I am missing alot of meta description tags. I have installed "All in One SEO" but there seems to be no options to add meta descriptions in portfolio posts. I have also written meta descriptions for 'tags' and whilst I can see them in WP they don't seem to be activated. 2. The blog has pages indexed by WP- called Part 2 (/page/2), Part 3 (/page/3) etc. How do I solve this issue of meta descriptions and indexed pages? 3. There is also a page for myself, the author, that has multiple indexes for all the blog posts I have written, and I can't edit these archives to add meta descriptions. This also applies to the month archives for the blog. 4. Also, SEOmoz tells me that I have too many links on my blog page (also indexed) and their consequent tags. This also applies to the author pages (myself ). How do I fix this? Thanks for your help 🙂 Regards Nadia
On-Page Optimization | | PHDAustralia680 -
Why isn't SEOMoz using File Extensions (*.html etc) on any of their web page URLs?
...and what is the SEO benefit of this? This video from Matt Cutts suggests using file extentions, except for a directory.
On-Page Optimization | | magicrob0 -
Do we need to use the canonical tag on non-indexed pages?
Hi there I have been working in / learning SEO for just over a year, coming from a non dev background, so there are still plenty of the finer points on-page points I am working on. Slowly building up confidence and knowledge with the great SEOMoz as a reference! We are working on this site http://www.preciseuk.co.uk (we are still tweaking the tags and content by the way- not finished yet!) Because a lot of the information is within accordians, a page is generated for each tab of the accordian expanded, for example: http://www.preciseuk.co.uk/facilities-management.php is the main page but then you also have: http://www.preciseuk.co.uk/facilities-management.php?tab=0 http://www.preciseuk.co.uk/facilities-management.php?tab=1 http://www.preciseuk.co.uk/facilities-management.php?tab=2 http://www.preciseuk.co.uk/facilities-management.php?tab=3 http://www.preciseuk.co.uk/facilities-management.php?tab=4 http://www.preciseuk.co.uk/facilities-management.php?tab=5 All of which are in the same file. According to the crawl test, these pages are not indexed. Because it is all in one file, should we add the canonical tag to it, so that this is replicated in all the tab pages that are generated? eg. Thanks in advance for your help! Liz OneResult
On-Page Optimization | | oneresult
liz@oneresult.co.uk2