Please take a look at my canonical tag - is it written right?
-
Hi there! I just changed the preferred domain settings from http://example.com to http://www.example.com and received a recommended action from Google: "Ensure that you specify the new host as canonical in all page links or sitemaps."
Could you please let me know if "the new host" is equal to "canonical" and if I have to include this tag into every page of my website ?
Thank you!
-
Thank you!
-
Unfortunately I'm not much of a coder, so I won't be able to guide you on the htaccess code piece. Regarding the Search Console items though, the tool treats every site that is setup as its own entity, which is why you need a country and XML for each. An example of why they do this because you might have different profiles for http://www.example.com/us and http://www.example.com/ca where the subfolder specifies the country. If they recycled the same info from each profile setup, the /ca site would be set to U.S. instead of Canada.
-
Thank you, Sean!
-
Logan,
Thank you very much for your advise! I figured out that it is going to be much of work going from page to page and set their canonicals:) Maybe updating my .htaccess will work out? I am wondering if that (please see below) would be the right thing to put in there?
RewriteEngine on
rewritecond %{http_host} ^example.com [nc]
rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]Also, when I added the property (http://www.example.com) yesterday and set it as preferred domain, I was suggested to change the target country and submit a sitemap file for both http://example.com and http://www.example.com. I don't quite understand why do they want me to do that if the country and the sitemap are obviously the same?
-
Kirupa,
The syntax of your canonical tag is correct. However, there are a couple things you should know before you continue:
1- When Google says "Ensure that you specify the new host as canonical in all page links or sitemaps." it means they want to to update internal links and your XML sitemaps, so it's more involved than simply updating your canonical tag. Basically anywhere your URLs are referenced should be updated to reflect your new www-canonical URL structure.
2- You may have provided that one tag as an example, but DO NOT put that exact tag on every page of your site. Doing so would point search engines to the homepage of your site from any page they visit. Canonical tags are basically soft redirects that search engines follow, so when a bot sees a canonical tag on one page that points to another page, they leave and go to where the canonical is pointing them. Google will often de-index URLs that canonicalize to another URL, which I'm assuming you don't want
-
Hey Kirupa,
Short answer is that you're all good. The canonical is correct.
All the best,
Sean
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
-
Hi! I first wrote an article on my medium blog but am now launching my site. a) how can I get a canonical tag on medium without importing and b) any issue with claiming blog is original when medium was posted first?
Hi! As above, I wrote this article on my medium blog but am now launching my site, UnderstandingJiuJitsu.com. I have the post saved as a draft because I don't want to get pinged by google. a) how can I get a canonical tag on medium without importing and b) any issue with claiming the UJJ.com post is original when medium was posted first? Thanks and health, Elliott
Technical SEO | | OpenMat0 -
Canonical URL Change
Hi, I have a Product Page, say www.example.com/product-title/.
Technical SEO | | viatrading1
Canonical URL is www.example.com/product-title/ I want to change its URL to www.example.com/product-title-2/
Canonical URL is www.example.com/product-title-2/
Can't do 301 Redirect. Is SEO Juice passed from www.example.com/product-title/ to www.example.com/product-title-2/ ? Thanks,0 -
Should I use canonicals? Best practice?
Hi there, I've been working on a pretty dated site. The product pages have tabs that separate the product information, e.g., a tab for specifications, a tab for system essentials, an overview tab that is actually just a copy of the product page. Each tab is actually a link to a completely separate page, so product/main-page is split into product/main-page/specs, product/main-page/resources, etc. Wondering if canonicals would be appropriate in this situation? The information isn't necessarily duplicate (except for the overview tabs) but with each tab as a separate page, I would imagine that's diluting the value of the main page? The information all belongs to the main page, shouldn't it be saying "I'm a version of the main page"?
Technical SEO | | anneoaks0 -
Canonical tag refers to itself (???)
Greetings Mozzers. I have seen a couple of pages that use canonical tags in a peculiar way, and I wanted to know if this way of using the tags was correct, harmless or dangerous: What I've seen is that on some pages like: www.example.com/page1 There's a canonical tag in the header that looks like this link href="http://ww.example.com/page1" rel="canonical" It looks as though the tag is "redirecting to itself", this seems useless (at least to me). Is there a case where this is actually a recommended practice? Will using the canonical tag in this way "hurt" the page's ranking potential? Cheers Jorge
Technical SEO | | Masoko-T0 -
Canonical: Is this a problem?
Hi!!
Technical SEO | | petrospan
I am running a small wordpress website and i have a question because i am a litle confusic about Rel Canonical notices in the crawl diagnostics! I have the seo by yoast and i have fix all the canonical url for my page, but i take notices. I must worried about it or is something that inform me that everyting is ok? rel.jpg rel.jpg0 -
Canonical URL
I previously set the canonical Url in google web masters to the non www version, when I check my on page opt, it tells me that I have a critical issue with this. Should I change it in google web masters back to the www version? if so is there the possibility of negative results? Or is there a better way to deal with this? Note, I have inbound links pointing to both types.
Technical SEO | | bronxpad0 -
Title tag same text as H1?
What is the group's opinion on whether or not the <title>tag should have the exact same text as the <h1> tag on the same page? Obviously both should contain the phrase that page is optimized for but is it better to have them be variants of each other, or both the same and maybe equal to the key phrase that page is optimized for? Thanks.</p> <p>Example:</p> <blockquote style="background: none repeat scroll 0% 0% #f7f7f7; padding-top: 5px; margin-left: 0px; padding-left: 2px; padding-bottom: 5px; white-space: nowrap; overflow-y: auto; font-family: monospace;"> <p>title: los angeles blue widgets</p> <p>h1: los angeles blue widgets</p> </blockquote> <p>Or,</p> <blockquote style="background: none repeat scroll 0% 0% #f7f7f7; padding-top: 5px; margin-left: 0px; padding-left: 2px; padding-bottom: 5px; white-space: nowrap; overflow-y: auto; font-family: monospace;"> <p>title: los angeles blue widgets</p> <p>h1: blue widgets in los angeles</p> </blockquote> <p>Where the page is trying to optimize for "los angeles blue widgets"</p></title>
Technical SEO | | scanlin0 -
Canonical for non-exist URL ?
Hi I have a website what has parameter URL. For example www.example.com/index.php?page_id=1&no=2 I want that search engine see my page URL as; www.example.com/toys/cars But this URL is not exist in my website. And when i externally enter this page it goes to 404 page. If i add canonical url as www.example.com/toys/cars to the page www.example.com/index.php?page_id=1&no=2, what happened ? Is the url at the serp change as www.example.com/toys/cars ?
Technical SEO | | SEMTurkey0