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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
Graemezee
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 204
Joined: Mon Aug 22, 2005 10:10 am

rel=canonical attribute

Post by 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: 204
Joined: Mon Aug 22, 2005 10:10 am

Re: rel=canonical attribute

Post by 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.

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: rel=canonical attribute

Post by sozzled » Sat Feb 17, 2018 4:42 pm



Locked

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