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
-
For an e-commerce product category page that has several funnels to specific products, for SEO purposes does it matter whether the category page's overview content is above or below those funnels?
We manage an e-commerce site. On a category page, there are several funnels to specific products. We moved the category overview content below those funnels to make it easier for users to quickly get to products. Seems more user friendly to me, but could that move of the main content to the lower part of the page be a negative ranking factor?
On-Page Optimization | | PKI_Niles0 -
If Product Pages Perform Well In Google then Is It Possible That Category Page Can perform Well In Google?
Hi All, For my ecommerce site I have optimized my product pages very nicely like good images, detailed information about products, good reviews, implemented schema for my product and reviews and very perfect onpage. Now my query is if my products pages performing well in google then there are chances that my category page rank well in google too? Thanks!
On-Page Optimization | | wright3350 -
Redirect Code Needed.
Hi, Please help me redirect the following pages in htaccess. https://www.mydomain.com/FolderA/FolderB/number-of-pages.html to **https://www.mydomain.com/FolderA/FolderC/FolderB/number-of-pages.html ** I want to redirect atleast 50 pages like this. Please help Thanks
On-Page Optimization | | Kashif-Amin0 -
What is the Impact of Canonical to a Canonical Page?
hey folks, How does google respond to this, canonical to a canonical page? i.e page A is canonical to Page which is already/also canonical to PAGE C. Thanks In advance AK
On-Page Optimization | | AnkammaRao0 -
Google rel hell
So apologies in advance for this question, but: Can someone explain whether as a site we should be using the "rel author" tag or the "rel publisher" tag? 1. We don't really need to distinguish between the people who write our content. 2. We definitely do need to establish ownership of our content, as unfortunately it has been widely copied. We are spending quite a bit of time filing DMCA notices. 3. Do we need to apply either tag to every page? Or does "del publisher" just need to be applied to the homepage to cover the rest of the site? 4. What looks better in the search results? - a person's face or a company logo? If prefer a face, but understand we need to promote our brand. Thanks P
On-Page Optimization | | dexm100 -
On-page report tool
This is a question regarding the advise this tool offer to increase the ranking of a webpage with focusing with a particularly keyword we choose. I give an example: On-page Report Card am checking my keywords and I use. "cleanse london" my surprise is Report card give an "F" for my target landing page http://www.purifyne.com , but the issue is I am already in first place first position. I know SEOmoz know have the algorithm from Google to know how to rank better but my issue is should be a little more accurate! at least. I don't want to be misunderstood here, I just want more guidance, to rank much better using this tool that I am paying for. Any thoughts?
On-Page Optimization | | teksyte0 -
Different pages for OS's vs 1 Page with Dynamic Content (user agent), what's the right approach?
We are creating a new homepage and the product are at different stages of development for different OS's. The value prop/messaging/some target keywords will be different for the various OS's for that reason. Question is, for SEO reasons, is it better to separate them into different pages or use 1 page and flip different content in based on the user agent?
On-Page Optimization | | JoeLin0 -
Why a page with an On Page A grade has a less good rank than a page with a F grade?
Why a page with an On Page A grade is ranked 17 in Google when the home page with a F grade is ranked 9 ? Thanks
On-Page Optimization | | Amadeus_eBC0