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
-
Tracking down rel="canonical" on Wordpress site
A rel="canonical" is being added to every page and post on my Wordpress site - not tag results, not category results. Not a major problem, right? Except that I don't know where it's coming from. I've tried tracking it down - change the theme back to a default one, turn off all the plugins - it's still there. Is it coming from .htaccess perhaps? The only issue it is causing is that it has causes me to have to turn off the canonical option in Platinum SEO as that was resulting in two identical rel=canon on each page. It doesn't seem to be causing problem but I'd like to get a better understanding of what it going on.
On-Page Optimization | | robandsarahgillespie0 -
Keyword Appearing on Home Page - Moz Page Grader
Hi Today I entered www.partydomain.co.uk through the Moz Page Grader and found that the Home Page is Ranked B. I noticed that an Area we could improve on is the amount of times we are using our main keyword "Fancy Dress" on the home page. Please can you take a look at www.partydomain.co.uk and scroll to the bottom of the page were the tabs are containing losts of content. I am thinking about removing all of thoose Tabs. Our Competitors dont have any content as such on the home page and are ranking higher than Party Domain for "fancy dress" What do you think ? remove all the tabs to be like the others that rank better? Or cut the text right down ? Thanks Adam
On-Page Optimization | | AMG1000 -
Contact pages coming up for keywords above landing pages
I have two examples of contact pages coming up over designated landing pages Keyword: Nickel Alloys for www.neonickel.com Keyword: Artificial Grass for www.artificialgrass4u.co.uk Is there anyway I can stop this happening?
On-Page Optimization | | icansee0 -
What's better for SEO a page per review or a page with all reviews?
Was wondering what's better for SEO. We have a platform where consumers can read and write reviews. But the question is: is it better to give one page per company with all the reviews on it? Or should we have different pages for the specific company? Example: Itunes has a company page with all reviews on the page, but not the whole review. You have to click further to view the whole review (new page), at the moment this the current situation. What if we place the whole reviews on the company page, so you don't have specific pages for the reviews? Hopefully can someone help us out. Contact me if it's not clear or you want more extended information. Kind regards
On-Page Optimization | | MozzieJr0 -
Canonical URL, cornerstone page and categories
If I want to have a cornerstone "page", can I substitute an actual page with a category archive of posts "page" (that contains many posts containing the target key phrase)? This way, if I make blog posts about a certain topic/ key phrase (example "beach weddings") and add a canonical URL of the category archive page to the individual posts, am I right then to assume google will see the archive page as the cornerstone page (and thereby won't see the individual posts with the same key phrase as competing)?
On-Page Optimization | | stephanwb0 -
Should I autogenerate 25k pages?
My main product is database conversion software. As we support tons of databases, it's pretty easy to generate thousands of pages simply by creating a template and changing source/target database name, some information on how to connect etc. Of course, getting links to that many autogenerated pages is close to impossible. So, not wanting to endanger my main site (http://www.spectralcore.com) I created a separate site (minisite) for this product alone (http://www.fullconvert.com). In two months this new site is live, it got to the point of having over 1k visitors per month. That's for a site with no inbound links or history. Now, my question is - should I create equivalent thing on my main site, with different template to avoid duplicate content - and leverage history and authority - or Google can get me penalized for this practice. I don't think 25k generated pages are a bad thing, they simply provide for tons of highly targeted landing pages. Am I wrong?
On-Page Optimization | | metadata0 -
Multiple silos/products/landing pages. How to design the root page for conversion?
Hi everyone, First post. Tried a few awkward searches on the topic but I must be using bad keywords. I'm re-designing a site that has multiple products and matching multiple audiences. This means we have multiple sillos for multiple groups of keywords with the supporting pages for each silo landing page. Currently I'm working on updating the look and text of those landing pages for each silo to increase conversion. This leaves me with the root web page. We get quite a lot of search traffic from people searching our brand name - so this results in clicks straight through to our root domain. There are no product specific landing pages because it could be any one of the 3-5 different personas we have hitting the site from that source. Does anyone have any good examples of where a site has had multiple products and needed to segregate their audience on a root top page? I'd like to see some examples and hear peoples thoughts. At the moment I'm thinking I need to fill that page up with trust factors as to why people should use us as a company, along with navigational elements in relation to each and every product so they can click through to the proper landing page. The main way I can see on executing that is to have a rotating banner with the same tag line "this is what we do" but be alternating between banners relating to each product.. with their own click through button to go to the respective landing page. Thoughts anyone? Example of sites doing this well?
On-Page Optimization | | specific0 -
Rel Canonical
Hi Folks I have 77 Rel Canonical warning, and mostly confuse me. Mainly because they seem to be the exact link I would expect for that page. So I'm not so sure why they have been flagged.... two examples below Any thoughts or tips? (please 🙂 ) | Page Title
On-Page Optimization | | PHDAustralia68
URL | Tag value | Page Authority | Linking Root Domains | | BlueTea: New Sydney Kitchen Designs Company, Renovations, Colour Designs http://bluetea.com.au/ bluetea.com.au/ 37 18 Blog | Blue Tea http://bluetea.com.au/2010/10/?cat=15 | bluetea.com.au/category/blog/ | 1 | 0 |
| |0