Rel="canonical" again
-
Hello everyone,
I should rel="canonical" my 2 languages website /en urls to the original version without /en. Can I do this from the header.php? Should I rel="canonical" each /en page (eg. en/contatti, en/pagina) separately or can I do all from the general before the website title?
Thanks if someone can help.
-
So, if I understood, my code to have in the header.php of the website should be:
hope im right :)
-
NetLogiQ Thank you.
This answer solves a lot of tricks i had in my head
Thank you very much, I will better study the link you sent, and try to implement on my website. Footers etc. are not translated, so they remain in the original language.. But while reading, I think the solution can fit to my problem.
Thanks again!
Eugenio
-
Hi,
As I see it, you don't need to use a rel="Canonical" because your pages are not duplicates. You have content in italian and translated content in English.
The only thing you need to do is add a rel="alternate" hreflang="x"
This is what Google recommends in case your website is fully translated.
Some example scenarios where
rel="alternate" hreflang="x"
is recommended: For example, you have both German and English versions of each page. Here is how you implement it: https://support.google.com/webmasters/answer/189077?hl=en1. Add a HTML link in the header - section for example:
2. HTTP header. If you publish non-HTML files (like PDFs), you can use an HTTP header to indicate a different language version of a URL: Link: <http: www.yourwebsite.eg="" en="">; rel="alternate"; hreflang="en".</http:>
-
hello james
Thanks for reply. I have original webpages in Italian. Translated webpages are in English. I use a plugin for wordpress, that allows me to translate the whole page (title, etc.) except the url, which will only be different because of the /en before the original page name (in italian, eg /en/contatti)
Widgets, footers etc. are still in Italian, even with translated pages.
I also thought about changing permalinks to be %postname%, so that url may adapt to title (? I think). But Im afraid this website wide urls change will affect my current rankings.
Any suggestion?
-
This is a response to both questions. Rel = canonical will give in this case the English page the authority, that should be the page that ranks well.
The main issue here is if the whole page is translated don't use a canonical tag, if the content stays in English and the Navigation/footer is changed use canonical tag to the English page as this would verge on duplicate content.
-
in fact, now that im thinking:
will not canonical confuse google if trying to rank also for the other language?
What will appear? this is duplicate in a sense, but is complete different content in the other sense.
Please correct me if im wrong..
-
this is what google replied to the same question, not very explicit at all!
"Canonical was not created to say that a language is another language, but that a duplicate page is just a variation and not the original page"
Im lost again but i also now think that rel canonical is the solution..
-
Just to add in here and simplify the process, Wordpress has a built in function to return the current post/page URL. Make use of 'get_permalink()', with some simply string manipulation you would be able to output the correct canonical tag to your page.
Edit: My PHP is a little rusty at times, but the following should sort you out:
//Check if the page you're on is a single post. If so run below.
if ( is_single() ) {
$url = get_permalink();
$canonical = str_replace('/en', '', $url);echo '';
};
?>As mentioned above, put this into your header.php file (in the template directory), where you would like the canonical tag to appear.
-
He isn't trying to redirect he does want both pages.
Also canonical sitewide is problematic unless you add a customized conditional at the PHP level. He has a wordpress site and can't edit the raw HTML of every page so he needs to have a PHP string at the global level which changes based on page variables.
-
Hello,
1. Do not add a canonical sitewide tag - here is a case study on why http://moz.com/blog/catastrophic-canonicalization Long story short - he deindexed 57% of his website.
2. You could 301 redirect all the pages, instead of adding a rel canonical. If your /en version is a duplicate of the original version, then you could simply add a code that redirects each page to the relevant version, like this: RedirectMatch 301 ^/en/(.*)$ http://www.yourwebsite.en/$1
You can use that solution in the case where you have a website called www.mywebsite.com that has a www.mywebsite.com/en version for a lot of links if not all, and those are the ones indexed in Google. You just add that code into htaccess. So just replace mywebsite with your website.
-
I don't want to post the same answer as I did to your previous question but perhaps there was further clarification that you needed, that I missed!
Put a conditional in the header. Since you are using a wordpress platform you can't go in and manually edit each pages canonical anyway. Using the page if function and a variable you would be able to assign each one it's own rel= from a central head file anyway.
In an ideal situation you'd do each page manually but because of your CMS you need to do a work around
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
-
Canonical tag not working
I have a weebly site and I put the canonical tag in the header code but the moz crawler still says that I'm missing the canonical tag. Any tips?
Technical SEO | | ctpolarbears0 -
Duplicate pages with "/" and without "/"
I seem to have duplicate pages like the examples below: https://example.com https://example.com/ This is happening on 3 pages and I'm not sure why or how to fix it. The first (https://example.com) is what I want and is what I have all my canonicals set too, but that doesn't seem to be doing anything. I've also setup 301 redirects for each page with "/" to be redirected to the page without it. Doing this didn't seem to fix anything as when I use the (https://example.com/) URL it doesn't redirect to (https://example.com) like it's supposed to. This issue has been going on for some time, so any help would be much appreciated. I'm using Squarespace as the design/hosting site.
Technical SEO | | granitemountain0 -
How to explain "No Return Tags" Error from non-existing page?
In the Search Console of our Google Webmaster account we see 3 "no return tags" errors. The attached screenshot shows the detail of one of these errors. I know that annotations must be confirmed from the pages they are pointing to. If page A links to page B, page B must link back to page A, otherwise the annotations may not be interpreted correctly. However, the originating URL (/#!/public/tutorial/website/joomla) doesn't exist anymore. How could these errors still show up? Screenshot%202016-07-11%2017.36.27.png?dl=0
Technical SEO | | Maximuxxx0 -
Organic search traffic stats "leaking" into other channels?
Hi Everyone I have a website and am slowly getting to grips with SEO. Last week I enabled a new channel in google analytics which was "email" so I could track effectiveness of the weekly emails we send out. The good news is that a ton of traffic is now being assigned to the email "channel" in GA but my organic search traffic in channels is now down week on week. That feels odd as my overall traffic to the site is up, week on week. Does anyone have any experience of new channels coming on stream and canniballising old ones? Could it be that some of the traffic associated to organic search previously was actually coming from my email, I just didn't know it? thanks all!
Technical SEO | | NappyValleyNet1 -
Need suggestions on what might be causing rankings drop from top5 to "not in 50"?
Hi All, Below a list of 4 keywords & respective URLs which raked in top 3 to 5 till around 2 months back, now all these are "not in top 50", and I need help with finding the exact reason. Can you all please help with suggestions on what I should be looking for under the hood. Oticon Hearing Aids:http://www.leightonshearingcare.co.uk/hearing-aids/oticon-hearing-aids.aspx Phonak Hearing Aids:http://www.leightonshearingcare.co.uk/hearing-aids/phonak-hearing-aids.aspx Widex Hearing Aids: http://www.leightonshearingcare.co.uk/hearing-aids/widex-hearing-aids.aspx Resound Hearing Aids:http://www.leightonshearingcare.co.uk/hearing-aids/siemens-hearing-aids.aspx Thanks in advance, any help will be very much appreciated, checked all the basic stuff, and appreciate that there is scope for improvement in terms of page content, internal links etc etc, but cant figure out the reason for such a massive drop in such a short while given the fact, that the these URLs ranked in top 3 to 5 for a few years till 2 months back. Please help!!!
Technical SEO | | LolhcSEO0 -
Should rel canonical tags include the root domain
It does sound like a silly question but bear with me a little... I recently installed on my Joomla website a module that automatically creates rel canonical tags for pages that contain lists that can be sorted by different criteria: (price, alphabetic order, etc...) I know that a proper canonical tag should look like this: However, the module I'm using creates the following structure Will this work? I mean, will it be "understood" by the bots? To see what the module actually does, you can visit the following link http://www.quipeutlefaire.fr/fr/index.php?sort=price&sort_direction=desc&limit=10&limitstart=0&option=com_auctions&category=240 In the source code you will see that the canonical tag is Which is the original "unsorted" page. Thanks in advance for your help
Technical SEO | | QPLF0 -
Video thumbnail pages with "sort" feature -- tons of duplicate content?
A client has 2 separate pages for video thumbnails. One page is "popular videos" with a sort function for over 700 pages of video thumbnails with 10 thumbnails and short desriptions per page. (/videos?sort_by=popularity). The second page is "latest videos" (/videos?sort_by=latest) with over 7,000 pages. Both pages have a sort function -- including latest, relevance, popularity, time uploaded, etc. Many of the same video thumbnails appear on both pages. Also, when you click a thumbnail you get a full video page and these pages appear to get indexed well. There seem to be duplicate content issues between the "popular" and "latest" pages, as well as within the sort results on each of those pages. (A unique URL is generated everytime you use the sort function i.e. /videos?sort_by=latest&uploaded=this_week). Before my head explodes, what is the best way to treat this? I was thinking a noindex,follow meta robot on every page of thumbnails since the individual video pages are well indexed, but that seems extreme. Thoughts?
Technical SEO | | 540SEO0 -
Syndication: Link back vs. Rel Canonical
For content syndication, let's say I have the choice of (1) a link back or (2) a cross domain rel canonical to the original page, which one would you choose and why? (I'm trying to pick the best option to save dev time!) I'm also curious to know what would be the difference in SERPs between the link back & the canonical solution for the original publisher and for sydication partners? (I would prefer not having the syndication partners disappeared entirely from SERPs, I just want to make sure I'm first!) A side question: What's the difference in real life between the Google source attribution tag & the cross domain rel canonical tag? Thanks! PS: Don't know if it helps but note that we can syndicate 1 article to multiple syndication partners (It would't be impossible to see 1 article syndicated to 50 partners)
Technical SEO | | raywatson0