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
-
How long does it take for canonical tags to work
How long on average does it take for a canonical tag to work? Understand that canonicals are just a suggestion, but after adding a canonical tag and submitting the page via Google fetch, assuming Google follows the canonical, would you expect it to work after a day or two or does it take longer? We added canonicals to old PPC landing pages that are ranking organically, though our new landing pages (which we want to rank organically) are not identical and have a bit more content/features. They are similar though. Canonicals were added to the old pages (pointing to new pages) and requested indexing via search console. Old pages are still ranking and new pages not so much. FYI we are unable to 301 old PPC pages due to other non negotiable reasons unfortunately. Thanks.
Technical SEO | | SoulSurfer80 -
Meta tag Syntax
Hi, This might seem silly. What is the correct syntax for the meta tag used when noindexing webpages? I have "". I have seen it both with and without the forward slash before the greater than sign. Does it make any difference if the forward slash is present or not? Cheers
Technical SEO | | McCaldin0 -
H1 tag options
Hi, Working on a website and the developer has asked some questions about the h1 tag placement... So the main page has a bold heading named 'Overview' which then has a left hand navigation to tab through the content which appears next to the nav. The main content then has a heading and content below it. The 'Overview' heading appears on all pages of the left nav so really shouldn't be the H1 tag as it would cause duplication. One option we have thought about is to have the right hand heading above the content be the h1, and it has been suggested to stylize the 'Overview' heading but it won't actually be an h1. My question is would this have any negative impact on SEO? Thanks!
Technical SEO | | J_Sinclair0 -
How to test a geo tagged homepage?
The e-commerance system we have has a geo tagged hompage system so you can set up different homepages based on the user country IP. But I want to test what the default homepage is, if the system can not get the user IP, does anyone know of a way to do this? Also does googles bot, not give an IP for this, or is it always an American IP (even if your site is set to a different country)? Thanks
Technical SEO | | PaddyDisplays0 -
Canonical tags
How hard is it to put in Canonical tags on a webpage? My web guy didn't do it because he put in redirects in place for all old URLs and all content
Technical SEO | | Boodreaux
(except error pages and advanced searches) should have a unique URL. By not having canonical tags does it lose link juice? Not sure if that question makes sense. 🙂 Poo1 -
Duplicate Title Tags On Blogs
Hello Mozzers, I have a client who has a blog and articles section on their website, due to the amount of content they have in these section they have multiples pages so it would be like.. www.bluewidgets.com/blog/p1 www.bluewidgets.com/blog/p2 www.bluewidgets.com/blog/p3 www.bluewidgets.com/blog/p4 All obvioulsy with seperate content in each blog/article posts but the meta descriptions on title tags for this p1,p2,p3,p4 and so on are all the same, is this a major issue? and if so how do I fix it?
Technical SEO | | Prestige-SEO0 -
Title Tag Wordpress
I need to know how can I personalize the title tag individually in my categories?
Technical SEO | | nafera20 -
Duplicate canonical URLs in WordPress
Hi everyone, I'm driving myself insane trying to figure this one out and am hoping someone has more technical chops than I do. Here's the situation... I'm getting duplicate canonical tags on my pages and posts, one is inside of the WordPress SEO (plugin) commented section, and the other is elsewhere in the header. I am running the latest version of WordPress 3.1.3 and the Genesis framework. After doing some testing and adding the following filters to my functions.php: <code>remove_action('wp_head', 'genesis_canonical'); remove_action('wp_head', 'rel_canonical');</code> ... what I get is this: With the plugin active + NO "remove action" - duplicate canonical tags
Technical SEO | | robertdempsey
With the plugin disabled + NO "remove action" - a single canonical tag
With the plugin disabled + A "remove action" - no canonical tag I have tried using only one of these remove_actions at a time, and then combining them both. Regardless, as long as I have the plugin active I get duplicate canonical tags. Is this a bug in the plugin, perhaps somehow enabling the canonical functionality of WordPress? Thanks for your help everyone. Robert Dempsey0