Fixing Duplicate Content - Canonical Pages

Discuss Search Engine Optimization in relation to Joomla!. This forum will also have discussions on SEF/SEO Joomla! extensions.

Moderator: General Support Moderators

Locked
chrisrkeller
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Tue Nov 30, 2010 2:41 am

Fixing Duplicate Content - Canonical Pages

Post by chrisrkeller » Mon May 30, 2011 10:52 pm

Has anyone run into duplicate content like the following?

1. http://www.profitworks.ca/blog/82-large ... -kitchener (preferred URL)
2. http://www.profitworks.ca/blog/82-large ... _fragment=
3. http://www.profitworks.ca/blog/902-blog ... -kitchener
4. http://www.profitworks.ca/blog/902-blog ... -kitchener
5. http://www.profitworks.ca/component/con ... -kitchener

Does anyone know how to set up a canonical link for this or how to correct the duplicate URLs?

robschmidt
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jun 02, 2011 8:25 pm

Re: Fixing Duplicate Content - Canonical Pages

Post by robschmidt » Thu Jun 02, 2011 8:38 pm

Something like?

<link rel="canonical" href="http://www.profitworks.ca/blog/82-large ... -kitchener" />

chrisrkeller
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Tue Nov 30, 2010 2:41 am

Re: Fixing Duplicate Content - Canonical Pages

Post by chrisrkeller » Thu Jun 02, 2011 9:18 pm

Yes, but how do I put that in the page?

I only created one of the URLs.....
The 902-blog/ and component/ urls I don't even know where they came from...

Also, how do I put code in the head of one article. I only know how to add code to the head of the template (which obviously won't work or it will go on all pages.

robschmidt
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jun 02, 2011 8:25 pm

Re: Fixing Duplicate Content - Canonical Pages

Post by robschmidt » Thu Jun 02, 2011 10:11 pm

Would it be better to delete the duplicate pages?

This thread sounds like it might be a similar issue? (http://forum.joomla.org/viewtopic.php?p=2505731)

chrisrkeller
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Tue Nov 30, 2010 2:41 am

Re: Fixing Duplicate Content - Canonical Pages

Post by chrisrkeller » Fri Jun 03, 2011 2:00 pm

That post does not seem related. In that one it sounds like it is actually creating two posts.

My problem is not two posts, but 3 different URL structures going to the same page (depending on how you go to the article (from blog front page, from search or from the "more articles" section on the blog frontpage

Any advice? I think the rel canonical link is a good fix but how do I get this into the HTML head for one specific article?

SheilaMary
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 100
Joined: Wed Jun 23, 2010 5:46 pm
Location: Marseille, France

Re: Fixing Duplicate Content - Canonical Pages

Post by SheilaMary » Tue Jun 07, 2011 7:46 am

I have the same problem. I want to use the canonical tag. But I can't find how to access the <head> in Joomla. The HTML editor does not seem to include the <head>, even though I can see it in the page source code.

I have posted a question about this elsewhere but although a number of people have viewed it, no-one has come forward to help. :(

Does anyone on this thread know how to access the <head> ?

User avatar
psantamaria
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 208
Joined: Tue Aug 26, 2008 8:14 pm
Location: Brisbane, Australia
Contact:

Re: Fixing Duplicate Content - Canonical Pages

Post by psantamaria » Wed May 16, 2012 2:16 am

HI, it is maybe too late to answer this, but I am facing the same problem now and I found a solution (I haven't tested it) in another forum. http://www.seomoz.org/q/quick-and-easy- ... ontent-fix

It is simple, he recommends adding the following code to header.php in the template:

Code: Select all

    <?php $canonical = & JURI::current(); ?>
    <?php $canonical = ltrim( $canonical, "http://www."); ?>
    <?php $canonical = preg_replace('~^/+|/+$|/(?=/)~', '', $canonical); ?>
    <?php $canonical = 'http://www.'.$canonical; ?><?php $canonical = rtrim($canonical,"/"); ?>

    <jdoc:include type="head" />

    <link rel="canonical" href="<?php echo $canonical ; ?>"/>
As my template doesn't have head.php, I'll include it on index.php

psexton
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Sep 11, 2012 4:37 pm
Location: Scottsdale, AZ
Contact:

Re: Fixing Duplicate Content - Canonical Pages

Post by psexton » Tue Sep 11, 2012 4:40 pm

The code from SEOMoz removes the trailing slash, but it doesn't take into account the multiple URLs that can exist for one page. Still looking for a solution.

corydos
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 147
Joined: Tue Feb 03, 2009 10:33 am

Re: Fixing Duplicate Content - Canonical Pages

Post by corydos » Mon Sep 24, 2012 4:28 am

ndelia wrote:Use robot.txt to exclude pages that you don't want indexed.
Can you show me an example of this please? I just don't know what to put down.

User avatar
simo9090
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Fri Jan 11, 2013 6:51 am
Location: North Carolina
Contact:

Re: Fixing Duplicate Content - Canonical Pages

Post by simo9090 » Fri Jan 11, 2013 8:44 pm

Dealing with Duplicate Pages

NOTE: Let me start out by saying I don't have a ton of experience with coding, so this may not be the best (or even right) way to do this, but after a day of working on it, this is what I believe works.

A. When I create an article in Joomla, for whatever reason, Joomla creates duplicate pages. Sometimes it creates multiple paths using the “Categories” I created in Joomla. When Google indexes my website and finds these different paths to the same article, it considers them as duplicate pages. For example, Google assumes I have duplicate pages when it finds the same article in each of these places:

http://www.m2820.com/teaching-sunday-school
http://www.m2820. com/conferences/teaching-sunday-school
http://www.m2820. com/teaching-sunday-school/index.php?option=com_content&view=article&id=1&Itemid=101

B. I can tell Google which page should be considered to be the master or original page that I want it to index and which pages it should ignore. I do this by using the rel=“canonical” link. This code should be placed on the non-canonical or on the duplicate pages, but I’m assuming (hoping?) it can also be placed on the original pages since that is the only ones I know how to gain access to. All the other pages are created by Joomla itself.

– For an explanation of using <link rel="canonical " href="your webaddress " /> see:
http://support.google.com/webmasters/bi ... wer=139394
– Example:
<link rel="canonical" href="http://www.m2820.com/teaching-sunday-school"/>

C. The <link ...> tag needs to be inserted into the <head> tag for each page and you can do this using Joomla’s JdocumentHTML/addCustomTag. See:
http://docs.joomla.org/JDocumentHTML/addCustomTag
http://docs.joomla.org/JDocumentHTML/addHeadLink

D. The JDocumentHTML is PHP code, so you need a way to insert it into the header <head>. NoNumber’s free version of Sourcerer will do this (http://www.nonumber.nl/extensions/sourcerer).

Install Sourcerer, then add the code below in your article. Note, you add it as regular text, not has HTML text. In other words, type it in as you would any other text. Don’t toggle the editor so you can see the HTML code that makes up the article.

• Instructions:
http://www.nonumber.nl/extensions/sourc ... -html-page

• Example code to add to article:
– You wrap the code you want in the header between Sourcerer’s {source} tags.
{source}<?php $doc->addCustomTag( '<link rel="canonical" href="http://www.m2820.com/teaching-sunday-school";/>' );?>{/source}

• This is the code that was added to the header:
<link rel="canonical" href="http://www.m2820.org/teaching-sunday-school"/>

Hope this helps anyone else trying to figure this out.

User avatar
3d web design
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Thu Jan 07, 2010 11:19 am
Location: Bulgaria, Sofia
Contact:

Re: Fixing Duplicate Content - Canonical Pages

Post by 3d web design » Wed Apr 29, 2015 2:52 pm

The best solution for Joomla 1.5 and 2.5 is this: http://www.concept-br.de/blog/canonical-tag-for-joomla/


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 1.5”