Link to the mod (https://custom.simplemachines.org/index.php?mod=1644)
SMF Canonical Tag (1.2) for SMF 1.1.x and 2.0 By Fuad (https://fuad.me/) & Nevacloud (https://nevacloud.com/)
This mod will adds a canonical tag for topics and boards. Helps search engines indexing your important pages. Preventing duplicate contents, and good for SEO :)
About canonical tag:
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
Any screenshots of the tag in use?
Nice mod. Should prove helpful
Quote from: CSS on February 16, 2009, 11:52:15 AM
Any screenshots of the tag in use?
How does one do a screenshot of a header meta tag?
Ohh sorry! I was looking at two different mods, this one and an avatar one. Sorry lol.
Really nice mod. Thank you @vmgamer.
Note, the canonical tag has been added to the development version of SMF 2.0, so it should be included in SMF 2.0 RC2.
(although it doesn't add it in exactly the same way as this mod).
What is your opinion about using this mod to existing forums? It's obvious that for new installations this would help much, but i don't know what would be the impact for existing indexed content.
My forum is quite new, it's 2 months old and i have ~ 300 pages indexed by google (most probably with duplicate links).
So, what this mod actually do? :-[
I noticed that in your forum, the address of a topic looks like this: http://simszone.org/absen-box/absen-disini/
and in source it has
<link rel="canonical" href="http://simszone.org/absen-box/absen-disini/" />
This means that the only link that will get PR credit, will be the one specified in the canonical tag? The other ones (like: URL/index.php?topic=x.0; URL/index.php/topic,x.0.html; URL/index.php?topic=x) will still be accessible but will pass PR only to SEF URL?
What mod did you used to have that kind of link (like URL/board/topic style)?
In your opinion it would be recommended for existing forums to apply SEO4SMF mod + canonical tag mod, and point as canonical link the SEF URL? I intended to use SEF URLs but beeing affraid to add one more link to my pages i gave up; now i shouldn't be affraid anymore regarding splitting PR between all the links?
Thanks and i apologies about my long post, but i tried to clarify things; i don't know much about seo and i guess other users will find an answer to this, helpful.
Many thanks.
Basically for various links which point to almost identical pages, it tells google which is the real one, and all PR juice is moved towards the real one.
After applying this mod,..... will i have "404 not found" since the links changed?
No, that won't
This mod only adds a rel="canonical" tag
Quote from: vmgamer on March 07, 2009, 08:12:33 AM
No, that won't
This mod only adds a rel="canonical" tag
Ah ok. Thanx. I looked at your website and read the previous post and it confused me as i think both of yous use the pretty url's mod.
VMGAMER,
Are you saying your mod will tell Google.. example.com/one/print-page should pass the love to.. example.com/one ??
If so, you're a frikking GOD lol.
See, Google has been indexing my example.com/one/wap2 pages instead of the original and I'm hoping your mod will make Google index the original/MAIN pages.
Please let me know ASAP and thanks again.
Low
Quote from: Low on April 07, 2009, 10:03:06 PM
VMGAMER,
Are you saying your mod will tell Google.. example.com/one/print-page should pass the love to.. example.com/one ??
If so, you're a frikking GOD lol.
See, Google has been indexing my example.com/one/wap2 pages instead of the original and I'm hoping your mod will make Google index the original/MAIN pages.
Please let me know ASAP and thanks again.
Low
I agree.
Low. Yes.
P.S This is a default feature in RC2 (when that is released)
I would like to also add a canonical tag to the index.php page.
My site is indexed in google with http://www.site.com/forum & http://www.site.com/forum/index.php
Both have different page ranks.
How can I adjust the code so it detects the boardindex and add a canoncical tag?
Original code:
if (!empty($context['current_topic']))
echo '
<link rel="canonical" href="', $scripturl, '?topic=', $context['current_topic'] . (!empty($context['start']) ? '.' . $context['start'] : '.0') . '" />';
elseif (!empty($context['current_board']))
echo '
<link rel="canonical" href="', $scripturl, '?board=', $context['current_board'] . (!empty($context['start']) ? '.' . $context['start'] : '.0') . '" />';
Oh what a shame, I just noticed on the demo link that the PRINT-pages have no tag :(
Seriously, Google loves to index everything except the original/main page so.... it's back to the drawing board for me.
Low
FYI:
I installed this and while looking through the view source of my topics, I noticed all the topics have the tag. Not just links like prev/next urls. Reading the google blog page (http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html) about the tag, they don't mention if it's ok to have a self-referential tag.
After some searching, I found the answer, and yes it's ok to have the tag on the main page as well:
http://extranet.mivamerchant.com/forums/showthread.php?p=95684
Quote from: Mr. Jinx on April 12, 2009, 06:11:38 AM
I would like to also add a canonical tag to the index.php page.
My site is indexed in google with http://www.site.com/forum & http://www.site.com/forum/index.php
Both have different page ranks.
How can I adjust the code so it detects the boardindex and add a canoncical tag?
Original code:
if (!empty($context['current_topic']))
echo '
<link rel="canonical" href="', $scripturl, '?topic=', $context['current_topic'] . (!empty($context['start']) ? '.' . $context['start'] : '.0') . '" />';
elseif (!empty($context['current_board']))
echo '
<link rel="canonical" href="', $scripturl, '?board=', $context['current_board'] . (!empty($context['start']) ? '.' . $context['start'] : '.0') . '" />';
I hard coded mine like this (added on the line after after the Canonical Tag code):
elseif ($context['page_title'] == 'Some Bands I Like - Index')
echo '
<link rel="canonical" href=http://www.somebandsilike.com/ />';
Obviously change the page title to match your index page's title, and the href to your index page's url.
Quote from: Low on April 22, 2009, 10:13:33 AM
Oh what a shame, I just noticed on the demo link that the PRINT-pages have no tag :(
Seriously, Google loves to index everything except the original/main page so.... it's back to the drawing board for me.
Low
You probably don't want a canonical tag on print pages as the layout is different from the main pages (would probably hurt your pagerank). Better to use noindex:
In Printpage.template.php, after the <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" /> line add:
<meta name="robots" content="noindex" />
This message indicates you should also have nofollow on the Print button link as well:
http://www.simplemachines.org/community/index.php?topic=125867.msg1928009#msg1928009
..but wiki article says nofollow may still be followed and indexed:
http://en.wikipedia.org/wiki/Nofollow
And this page will make your head spin:
http://www.iterasi.net/openviewer.aspx?sqrlitid=aa2jetsqhuemfdor8y9zeq
And after studying the code to figure out how to add nofollow to the print button, I decided not to bother (I gave up trying to figure it out...).
If anyone wants to try, around lines 170 in Display.template.php builds the button arrays, and the mod code would probably be added to the template_button_strip function in index.template.php. The part I couldn't figure out is what variable to test for 'print' context. This is with v1.1.8.
would it be possible to add an option to pick the cononical tag for a topic? I'm using SSI to display posts on other pages and I want the pages pulling from the forum to be the indexed pages. Something like the attached image is what i'm talking about. Of course it could only be available for admins.
Thanks for this mod vmgamer. :)
Appears an error when I tried to install the mod in the Pakage zone.... in the 1.1.10 version.
So I installed it manually and works perfect!!!!
Thank you very much!, Improving SEO!
Greetings.
Quote from: sixthofmay on May 02, 2009, 09:09:42 PM
I hard coded mine like this (added on the line after after the Canonical Tag code):
elseif ($context['page_title'] == 'Some Bands I Like - Index')
echo '
<link rel="canonical" href=http://www.somebandsilike.com/ />';
Obviously change the page title to match your index page's title, and the href to your index page's url.
Thanks! I think code like this should be include in the mod for perfection. Great for SEO!
Quote from: Mr. Jinx on September 28, 2009, 01:04:01 PM
Quote from: sixthofmay on May 02, 2009, 09:09:42 PM
I hard coded mine like this (added on the line after after the Canonical Tag code):
elseif ($context['page_title'] == 'Some Bands I Like - Index')
echo '
<link rel="canonical" href=http://www.somebandsilike.com/ />';
Obviously change the page title to match your index page's title, and the href to your index page's url.
Thanks! I think code like this should be include in the mod for perfection. Great for SEO!
Or you can use this
if (isset($context['current_action']) && $context['current_action'] == 'someaction')
echo '
<link rel="canonical" href=http://www.somebandsilike.com/ />';
You must change someaction tou what you want. :P
Love this mod, i think it should be included in smf by default :)
Please, I am curious about these questions:
What is the relationship between this mod and PrettyURLs?
Can they be used together?
In addition: Is it similar to H tags?
Quote from: 4LP3RUZ1 on October 19, 2009, 06:35:37 AM
Love this mod, i think it should be included in smf by default :)
In SMF 2.0 it is installed by default :)
I successfully installed the mod and observed the difference in the source code. I am waiting for its action on my site PR.
Thanks to the mod author!
Canonical is native in SMF 2RC3?
Is there any difference between this mod and http://custom.simplemachines.org/mods/index.php?mod=2129 this mod?
I have both of them in my forum... Do i really need both of them?
1.1.13
You need this one more than you need the other one.
This one tells search engines to consider pages as duplicates of each other as appropriate (which means you don't get penalised for duplicate content), the other affects meta tags which have no SEO benefit.
So i guess i should uninstall "KeyWords Generator (AutoKeywords)"
*shrug* It doesn't hurt, it just doesn't help.
I am getting a lot of duplicated content from google webmaster tools, how do I make this one page instead of 5 pages with the same content?
/android-applications/av-for-incredible/
/android-applications/av-for-incredible/msg12337/
/android-applications/av-for-incredible/msg12426/
/android-applications/av-for-incredible/msg12439/
/android-applications/av-for-incredible/msg12440/
Thank you for the wonderful mod! I thought I'd let everybody know that when I updated my forum from 2.0 RC5 to 2.0 Gold, I had to reinstall all my mods. This mod installed without issues and without emulation. Hope this info helps someone!
You do not need to install this mod on 2.0 Gold.
Canonical support is included by default now.
Sweet! Now if only they would integrate the other 80 mods I have installed :P
Anyways, thanks for the information!
After installing this mod. I still get a lot of duplicate content from Google and it has totally decrease all my index topics from 5000 Index topic to 50. I discovered my urls are
http://url.com/index.php
And
http://url.com
Both URL works on my forum. how can I fix this??