Page 1 of 1
Use {$extra} to avoid duplicate in News and CGBlog?
Posted: Wed Dec 10, 2014 6:52 pm
by pwg
Hi,
I have a client running a Christmas campaign, predominately on social media but with news posts and some duplicate copy into CGBlog (which I use as their recipe section). I would prefer the recipe content rank.
To avoid duplicate content penalties, I assign the extra field as a variable in the News detail template, and added
Code: Select all
{if isset($canonical)}<link rel='canonical' href='{if ! empty($extra)}{$extra}{else}{$canonical}{/if}'/>{elseif isset($content_obj)}<link rel='canonical' href='{$content_obj->GetURL()}'/>{/if}
To my head content, and just place the "correct" recipe URL into the Extra field on the News article. I hide the field with css.
Seems to work, but I'm wondering if this is the best way to do this?
Thanks for any advice. My client has taken a one day Google course - and a little knowledge is a very dangerous thing!
Cheers,
Paul
Re: Use {$extra} to avoid duplicate in News and CGBlog?
Posted: Wed Dec 10, 2014 7:43 pm
by velden
I'm no SEO expert, but does this mean you set a canonical url to a page (content) that actually NOT is the current page?
I bet that would be considered bad behavior.
I hide the field with css.
Why? Just don't print the field would be better I guess.
Or are you still using the template's default foreach loop? That should not be necessary.
Re: Use {$extra} to avoid duplicate in News and CGBlog?
Posted: Wed Dec 10, 2014 7:56 pm
by pwg
Thanks velden, it does (meaning I'm pointing page a to page b).
I followed ideas from here:
http://moz.com/learn/seo/duplicate-content.
I can easily add the page to robots.txt - perhaps that would be better?
I was using the default foreach, but have removed it now - thanks.
Obviously, I'm really no SEO expert!
Thanks,
Paul
Re: Use {$extra} to avoid duplicate in News and CGBlog?
Posted: Wed Dec 10, 2014 8:13 pm
by velden
Well maybe it's fine to use that method.
Re: Use {$extra} to avoid duplicate in News and CGBlog?
Posted: Wed Dec 10, 2014 11:40 pm
by JohnnyB
{if isset($canonical)}<link rel='canonical' href='{if ! empty($extra)}{$extra}{else}{$canonical}{/if}'/>{elseif isset($content_obj)}<link rel='canonical' href='{$content_obj->GetURL()}'/>{/if}
I think that is a good way to do it. The main thing is to have only one canonical link for each article, regardless of how many links actually open the article. So, if your method is doing that, then it is good and creative.
The only drawback is having to manually add the URL into your $extra field

Re: Use {$extra} to avoid duplicate in News and CGBlog?
Posted: Thu Dec 11, 2014 1:53 am
by pwg
Thanks JohnnyB, my concern is that one of the articles is coming from the News module and the other CGBlog.
They just both have virtually the same content. Perhaps not logical or ideal, but how the client wants it.
I'm still wondering if I should just add the "unwanted" article to robots.txt?
cheers,
Paul
Re: Use {$extra} to avoid duplicate in News and CGBlog?
Posted: Thu Dec 11, 2014 3:24 am
by JohnnyB
They just both have virtually the same content. Perhaps not logical or ideal, but how the client wants it.
I'm still wondering if I should just add the "unwanted" article to robots.txt?
You can add the path to the unwanted ones in Robots.txt using a wildcard for the path. And/or set a noindex meta tag in the detail page's metadata and google et al will not index those. It might be easier than setting a canonical for each entry but they won't be indexed at all whereas the your original solution will at least get those indexed.
Re: Use {$extra} to avoid duplicate in News and CGBlog?
Posted: Thu Dec 11, 2014 6:42 pm
by pwg
Thanks JohnnyB, appreciate the help/advice.
cheers,
Paul