rel=canonical attribute

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

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Graemezee
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 141
Joined: Mon Aug 22, 2005 10:10 am

rel=canonical attribute

Postby Graemezee » Fri Aug 11, 2017 10:06 am

Most of the info and plugins i have found for Joomla seem to focus on duplicate content within a site I manage a networking groups site and the members would like to re post blogs and articles from their own site on the networking site

I am looking for some way to slip the rel=canonical attribute for the particular article in the header page of this article

Code: Select all

<link href="URL OF ORIGINAL PAGE" rel="canonical" /> 


any thoughts appreciated

Graemezee
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 141
Joined: Mon Aug 22, 2005 10:10 am

Re: rel=canonical attribute

Postby Graemezee » Wed Aug 16, 2017 4:13 pm

Have been looking at PHPDirect and Sourcer to try and insert the rel=canonical attribute
into the header with something like:

Code: Select all

$document  =& JFactory::getDocument();
$document->addCustomTag('<link rel="canonical" href="URL OF ORIGINAL PAGE"/>');?>

or

Code: Select all

<?php $doc->addCustomTag( '<link rel="canonical" href="URL OF ORIGINAL PAGE";/>' );?>


even

Code: Select all

<?php  $document->addCustomTag(  '<link rel="canonical" href="URL OF ORIGINAL PAGE" />' );?>   


Mostly nothing happens or the screen goes white appreciate any help even to know if this is possible.


Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 4 guests