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
-
Shifting target keyword to a new page, how do we rank the internal page?
I have been targeting one keyword for home page that was ranking between the postilion 6-7 but was never ranking on 1st as there were 2 highly competitive keywords targeted on the same page, I changed the keyword to an internal service page to rank it on 1st, I have optimized the content as well but the home page is still ranking on 11th, how do I get the internal page rank on that keyword
On-Page Optimization | | GOMO-Gabriel0 -
Category page canonical tag
I know this question has been asked a few times on here but I'm looking for very specific advice. Currently when you go to a category, say http://www.bronterose.co.uk/range.html, a canonical tag is added to the head of the page. There are plenty of "variant" pages which carry the same tag, for example: /range.html?p=2
On-Page Optimization | | crichardson9
/range.html?p=3
/range.html?dir=asc&order=price
/range.html?dir=asc&limit=all&order=price Is it wise to push the "link juice" for each of these variant pages to the top level page? Or should each variant page have its own unique canonical tag? After reading many blog posts, guides and papers I'm truly confused! Any general guidance or recommendations would be much appreciated. Chris.1 -
Too Many On-Page Links
Ok so I am very new to MOZ, and we have just set up our PRO account and campaign. When we got our crawl results we had 4 pages with "too many on-page links". All of these pages correspond with our blog, which is a wordpress hosted blog that is integrated into our site. Our site is www.moxicopy.com and the blog is www.moxicopy.com/blog I am confused on how we have over 100 on page links on these pages, as we have very few links on our blog.
On-Page Optimization | | Moxicopy.com0 -
Should i make all of my pages with canonical tag
Hi, Im using thesis Wordpress theme, and their default option is "Add canonical <acronym title="Uniform Resource Locator">URL</acronym>s to your site" im just wandering if i should keep that box checked and apply canonical <acronym title="Uniform Resource Locator">URL</acronym>s to all of my pages? Thank You
On-Page Optimization | | Vmezoz0 -
Too many on page links in sitemap.html
My crawl report is flagging an issue with too many links to one of my pages, this page is my sitemap.html. However, I have coded the page so that if required is specified it generates an .xml version of the page and if not then the html version is displayed. What is the best way to stop the crawl finding the html version whilst maintaining it on the site for clients navigation?
On-Page Optimization | | SamPenno0 -
Page title changes based on results per page
I have a product listing that allows customers to set a results per page option. This ads a GET variable to the URL. I've added the page number to the title of this page if they go past the first page. If this results per page variable is added to the URL then google see it as a different page. Do I need to change the page title for this?
On-Page Optimization | | BedInABox.com0 -
Web Page Refresh
Hi there, we redesign our Website, changing it for a jquery based version. This new design is much more usable and nice for our users, however the average page views for user decreased a lot. Basically this is due to the fact that once the user is logged in, it spends most of the time in the same Web form which is updated through jquery without refreshing it. We were thinking about adding a meta refresh tag, or ad some javascript for getting this task done in order to get the relation page views/visitor increased. Do you think refreshing the page every 4 minutes could be penalized by Google (or other Search engines) ? Which should be the interval between refresh ? Would it be better to make it very explicit (i.e. adding a meta refresh tag) or using a kind of hide javascript ? We want to increase the pageviews but of course, we don't want to get penalized
On-Page Optimization | | martincad0 -
Should one page with markers or six separate pages?
Hi - I'm working on a site that was set up with 6 bios on one page, with markers jumping to each person's name. I was thinking about separating those into 6 different pages, but not sure if that's the right thing to do. Advice about keeping the bios on one page vs splitting them up? (Am I more likely to rank for those peoples' names if I have a unique page, or is the one page url with each different marker in it, just as good?) Ranking well for those names isn't a huge goal of the site, but it would be nice to make the choice that would help with that rank. Thanks for your input Emma
On-Page Optimization | | emmas0