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
-
Does "google selected canonical" pass link juice the same as "user selected canonical"?
We are in a bit of a tricky situation since a key top-level page with lots of external links has been selected as a duplicate by Google. We do not have any canonical tag in place. Now this is fine if Google passes the link juice towards the page they have selected as canonical (an identical top-level page)- does anyone know the answer to this question? Due to various reasons, we can't put a canonical tag ourselves at this moment in time. So my question is, does a Google selected canonical work the same way and pass link juice as a user selected canonical? Thanks!
Technical SEO | | Lewald10 -
SEO advice on ecommerce url structure where categories contain "/c/"
Hi! We use Hybris as plattform and I would like input on which url to choose. We must keep "/c/" before the actual category. c stands for category. I.e. this current url format will be shortened and cleaned:
Technical SEO | | hampgunn
https://www.granngarden.se/Sortiment/Husdjur/Hund/Hundfoder-%26-Hundmat/c/hundfoder To either: a.
https://www.granngarden.se/husdjur/hund/hundfoder/c/hundfoder b.
https://www.granngarden.se/husdjur/hund/c/hundfoder (hundfoder means dogfood) The question is whether we should keep the duplicated category name (hundfoder) before the "/c/" or not. Will there be SEO disadvantages by removing the duplicate "hundfoder" before the "/c/"? I prefer the shorter version ofc, but do not want to jeopardize any SEO rankings or send confusing signals to search engines or customers due to the "/c/" breaking up the url breadcrumb. What do you guys say and prefer from the above alternatives? Thanks /Hampus0 -
Google Webmaster Tools is saying "Sitemap contains urls which are blocked by robots.txt" after Https move...
Hi Everyone, I really don't see anything wrong with our robots.txt file after our https move that just happened, but Google says all URLs are blocked. The only change I know we need to make is changing the sitemap url to https. Anything you all see wrong with this robots.txt file? robots.txt This file is to prevent the crawling and indexing of certain parts of your site by web crawlers and spiders run by sites like Yahoo! and Google. By telling these "robots" where not to go on your site, you save bandwidth and server resources. This file will be ignored unless it is at the root of your host: Used: http://example.com/robots.txt Ignored: http://example.com/site/robots.txt For more information about the robots.txt standard, see: http://www.robotstxt.org/wc/robots.html For syntax checking, see: http://www.sxw.org.uk/computing/robots/check.html Website Sitemap Sitemap: http://www.bestpricenutrition.com/sitemap.xml Crawlers Setup User-agent: * Allowable Index Allow: /*?p=
Technical SEO | | vetofunk
Allow: /index.php/blog/
Allow: /catalog/seo_sitemap/category/ Directories Disallow: /404/
Disallow: /app/
Disallow: /cgi-bin/
Disallow: /downloader/
Disallow: /includes/
Disallow: /lib/
Disallow: /magento/
Disallow: /pkginfo/
Disallow: /report/
Disallow: /stats/
Disallow: /var/ Paths (clean URLs) Disallow: /index.php/
Disallow: /catalog/product_compare/
Disallow: /catalog/category/view/
Disallow: /catalog/product/view/
Disallow: /catalogsearch/
Disallow: /checkout/
Disallow: /control/
Disallow: /contacts/
Disallow: /customer/
Disallow: /customize/
Disallow: /newsletter/
Disallow: /poll/
Disallow: /review/
Disallow: /sendfriend/
Disallow: /tag/
Disallow: /wishlist/
Disallow: /aitmanufacturers/index/view/
Disallow: /blog/tag/
Disallow: /advancedreviews/abuse/reportajax/
Disallow: /advancedreviews/ajaxproduct/
Disallow: /advancedreviews/proscons/checkbyproscons/
Disallow: /catalog/product/gallery/
Disallow: /productquestions/index/ajaxform/ Files Disallow: /cron.php
Disallow: /cron.sh
Disallow: /error_log
Disallow: /install.php
Disallow: /LICENSE.html
Disallow: /LICENSE.txt
Disallow: /LICENSE_AFL.txt
Disallow: /STATUS.txt Paths (no clean URLs) Disallow: /.php$
Disallow: /?SID=
disallow: /?cat=
disallow: /?price=
disallow: /?flavor=
disallow: /?dir=
disallow: /?mode=
disallow: /?list=
disallow: /?limit=5
disallow: /?limit=10
disallow: /?limit=15
disallow: /?limit=20
disallow: /*?limit=250 -
Is "Above the Fold Content" still a thing?
Many of our pages have the textual content stuffed at the bottom of the page because the manager doesn't think anybody reads it and it is an eyesore to have at the top: http://www.stevinsontoyotawest.com/schedule-service For some light reading here is Google’s official blog talking about content quality:
Technical SEO | | MEllsworth
http://googlewebmastercentral.blogspot.co.uk/2012/01/page-layout-algorithm-improvement.html This references Ads vs Content showing above the fold. However, in our case it has to do with images vs ads and stuffing text at the bottom of pages. Here is a bit of heavier reading. You can do a quick search for "Fold" to see their interpretation.
http://macedynamics.com/research/content-quality-score/ I understand that images are still content, however hardly any of the images have Alt text and they are not even named with keywords so Google really can't distinguish what the page is about through images alone. I'm not about to go through the entire site and add Alt text and rename images because I have much more to do on my plate. So, the questions is: Is stuffing content at the bottom of the page, below all images/inventory/widgets ok to do or should we stick with the eyesore content at the top of the page? Thoughts?0 -
New "Static" Site with 302s
Hey all, Came across a bit of an interesting challenge recently, one that I was hoping some of you might have had experience with! We're currently in the process of a website rebuild, for which I'm really excited. The new site is using Markdown to create an entirely static site. Load-times are fantastic, and the code is clean. Life is good, apart from the 302s. One of the weird quirks I've realized is that with oldschool, non-server-generated page content is that every page of the site is an Index.html file in a directory. The resulting in a www.website.com/page-title will 302 to www.website.com/page-title/. My solution off the bat has been to just be super diligent and try to stay on top of the link profile and send lots of helpful emails to the staff reminding them about how to build links, but I know that even the best laid plans often fail. Has anyone had a similar challenge with a static site and found a way to overcome it?
Technical SEO | | danny.wood1 -
Rel="Follow"? What the &#@? does that mean?
I've written a guest blog post for a site. In the link back to my site they've put a rel="follow" attribute. Is that valid HTML? I've Googled it but the answers are inconclusive, to say the least.
Technical SEO | | Jeepster0 -
Why crawl error "title missing or empty" when there is already "title and meta desciption" in place?
I've been getting 73 "title missing or empty" warnings from SEOMOZ crawl diagnostic. This is weird as I've installed yoast wordpress seo plugin and all posts do have title and meta description. But why the results here.. can anyone explain what's happening? Thanks!! Here are some of the links that are listed with "title missing, empty". Almost all our blog posts were listed there. http://www.gan4hire.com/blog/2011/are-you-here-for-good/ http://www.gan4hire.com/blog/2011/are-you-socially-awkward/ MaeM3.png TLcD8.png
Technical SEO | | JasonDGreat0 -
How do you add a description to the Meta Description area to Tag Pages in Wordpress? This way I do not get the errors: "Missing Meta Description Tag" from SEOMoz Bot? Thanks!
I tried to add descriptions to my tags in Wordpress (well actually one to test), but I still keep getting the "Missing Meta Description Tag" error. Any suggestions on how to fix this in Wordpress? Thanks!
Technical SEO | | jhblogger0