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
-
Questions About The Right Hosting
Hi All, I have a few questions about the right type of hosting that I should be using. I understand that many people say we should be using the best hosting that we can afford. However, when I have a website with just 650 pages / posts is it really worth worrying too much about where I am hosting. I am UK based so at the moment I am using a UK host along with a CDN. I have a unique IP address and on a server that has a limited amount of websites on it. The main question is there really any need to be looking at anything else. The truth is I have used cloud hosting before and the website loaded slower around the world with that than it does with my current setup. Thanks
Technical SEO | | TTGUK0 -
Canonical tag or 301
Hi, Our crawl report is showing duplicate content. some of the report I am clear about what to do but on others I am not. Some of the duplicate content arises with a 'theme=default' on the end of the URL. Is this version of a page necessary for people to see when they visit the site (like a theme=print page is) in which case I think we should use a canonical tag, or is it not necessary in which case we should use a 301? Thanks
Technical SEO | | Houses0 -
Too Many noindex,follow Tags
Can you have too many pages on one site with noindex,follow tags? Just curious, because we're looking to noindex,follow lesser important pages such as bios about our team, privacy and terms, etc.
Technical SEO | | Prospector-Plastics0 -
Rel = Canonical in Blog Posting
Hello, I keep coming back to rel=canonical issues! I noticed when I "view pagesource" that my drupal blog posting automatically creates link rel="canonical" href="/sample-blog-title" /< pattern (with the > reversed) in the source code. I'm getting a lot of Rel=Canonical warnings and double content warnings from Seomoz so I've been trying to insert link rel="canonical" href="http://www.example.com/blog/my-awesome-blog-post"< but the page won't retain the code for some reason. I'm entering the code in Plain Text, but saving the document as Full HTML. Is there a better piece of code I can put in to demonstrate that the original blog page is the original source? Thanks!
Technical SEO | | OTSEO0 -
Notice - canonical tag
I've got several errors pointing to canonical tag, but do not know how to solve.Any help? Rel Canonical Found 6 days ago <dl> <dt>Tag value</dt> <dd>http://www.yougraph.com/</dd> <dt>Description</dt> <dd>Using rel=canonical suggests to search engines which URL should be seen as canonical.</dd> </dl> <a class="more expanded">Minimize</a>
Technical SEO | | nlopes1 -
Duplicate content + wordpress tags
According to SEOMoz platform, one of my wordpress websites deals with duplicate content because of the tags I use. How should I fix it? Is it loyal to remove tag links from the post pages?
Technical SEO | | giankar0 -
Canonical tags/wordpress permalink question
Need help: Do canonical tags do the exact same thing that wordpress already does with it’s permalink function? Or are these 2 separate things? thank you.
Technical SEO | | bonnierSEO1 -
Duplicate Content and Canonical use
We have a pagination issue, which the developers seem reluctant (or incapable) to fix whereby we have 3 of the same page (slightly differing URLs) coming up in different pages in the archived article index. The indexing convention was very poorly thought up by the developers and has left us with the same article on, for example, page 1, 2 and 3 of the article index, hence the duplications. Is this a clear cut case of using a canonical tag? Quite concerned this is going to have a negative impact on ranking, of course. Cheers Martin
Technical SEO | | Martin_S0