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!
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
-
When making content pages to a specific page; should you index it straight away in GSC or let Google crawl it naturally?
When making content pages to a specific page; should you index it straight away in GSC or let Google crawl it naturally?
On-Page Optimization | | Jacksons_Fencing0 -
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 -
Impact of number of outgoing links on Page Rank of an optimized page?
What is the current best practice on preferred number of outbound links on a page you are trying to rank with: According to online resources form a pure page rank perspective a high number of outbound follow links can have a negative impact not only on child pages but also the page itself
On-Page Optimization | | thomaspro
http://pr.efactory.de/e-outbound-links.shtml Other resources suggest that particularly placing high quality outbound links on a page (nofollow) increases the trust and authority of a page Are there any other elements to keep in mind? Is the best practice to avoid any follow links on a page you want to rank well in Google for? Thanks /T0 -
Homepage On-page Optimization
How do you all handle homepage optimization, if you (or a client) offers a variety of services? Our homepage has the strongest link profile of any of our pages, but it lists all the areas of law we cover. Therefore, it has too many keywords and none really rank well. Should we just pick our most profitable areas and optimize for that? www.kempruge.com in case anyone would benefit from looking at the actual page. Thanks, Ruben
On-Page Optimization | | KempRugeLawGroup0 -
301, Canonical, and Page Authority
I have been trying to find an answer to this question for awhile now but I am having trouble. I have a clients site that I need to redirect and Canonical the pages to correct duplicate content issues and title tags however, the issue with this client is that some of the www. pages have a higher PA than non-www and the reverse is true. I am wondering if there is an issue with chasing the PA to get the highest PA per page (even if this means the site is going to be a mix of www. and non-www. pages)? I am extremely new to SEO so I apologize ahead of time if I missed this in the forum.
On-Page Optimization | | Highline_Ideas0 -
Canonical tag?
I have an e-commerce website and the query strings of the URL's are causing duplicate content/titles. I'm thinking of adding a site-wide canonical tag which should fix them all. Any other ideas of making it neater or better?
On-Page Optimization | | KarlBantleman0 -
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 -
Optimization of home page
Hi there I have an issue which, despite searching hard, I simply cannot find the right solution for. We have an index page that used to rank pretty well for a main industry keyword. However following a revamp of the site last year the kw slipped and no longer brings in decent traffic levels. The problem seems to be that the old static site had a sprinkling of variable anchor text links that brought value to the home page. Instead of the main anchor being "home" we would revert to "main keyword" and variations across the site sometimes in t he content but mainly on the nav bars. However the new CMS design structure restricts us considerably with anchor distribution and so instead we opted for the site logo on the masthead to have an ALT tag for "main keyword" but so as not to game google too much we added .."home" to the tag. Probably pointless but we figured it could do no harm. This ALT text is site wide Problem now is that we have lost the spread of internal nav bar anchors and variety etc. We have slipped in the serps for "main keyword" and I cant help thinking we are not maximising the anchors as we should. So what Im coming to is this.... How can we tell if Google is picking up the ALT tage anchor as the main anchor to rank the site at the expense of all internal text anchors. Despite retaining lots of embedded anchors - according to the Moz metrics these are not being picked up because OSE suggests the ALT tag anchor is taking precedence. The serps probably support this view as well. Should we: a) Vary the masthead ALT if there is no way of avoiding this being the most important link / anchor on the page b) Remove the ALT anchor and instead opt for content links high on the page (we do have nav bar links saying "Home" site wide as well which may overrid the embedded links?) c) Leave the ALT alone and still push for content anchors as described in b) What is the best way to handle this..? Best wishes and thanks Morch
On-Page Optimization | | Morch0