Search Engine Optimization

From Lyceum

Jump to: navigation, search

Contents

Intro

I have decided to look into techniques to increase traffic to my site through various SEO methods. Recently I started using Firestats and discovered I have a fair amount of traffic on my blog and wiki and so decided to integrate some tools like Digg buttons and badges and social bookmarking tools, etc. This is a bit tricky, especially for Mediawiki, so here are my notes on the matter.

As I play with more SEO tools I will add them here. If you would like to see an example of the AddThis button and Digg Badges on my Wordpress Blog you can do so here.

Thanks for dropping by and good luck getting more traffic and using these tools.

(Please note this Wiki is for my own notes and is closed for editing)

AddThis Widget - Wordpress

This widget will add a nice drop down widget at the end of each post. The button will look like this on your Blog, but the drop down menu does not actually work on this version - see the one at the bottom of this page for a drop down example)

Getting the AddThis Widget working in Wordpress is substantially easier than in MediaWiki. It is available as a simple plugin for Wordpress requires very little configuration.

Here is the general outline of steps:

  • Download the AddThis Wordpress plugin from http://blog.addthis.com/?p=24
  • Follow instruction there to upload to your Wordpress plugin directory
  • Add you AddThis user name to var $addthis_username in the addthis_social_widget_drop.php file

Digg Badge - Wordpress

Now that you have AddThis, and people can Digg your posts, wouldn't it be nice to have a Digg Badge displayed on any posts that get Dugg? There is another Wordpress plugin for that too. It will only show badges for articles that get Dugg, so you don't have Badges with 0 diggs on them (who wants that?) It works quite well.

  • Download the plugin from here
  • Unzip and upload to your Wordpress plugin directory
  • Modify both the index.php and single.php files in whatever theme(s) you are using. Note that you MUST do this or the Digg Badge will not show up in your posts if someone Diggs it.
  • Just add <?php digg_this_button(); ?> to the above two files, placed within The Loop - for example, my themes index.php and single.php contain:
?php if(have_posts()): ?><?php while(have_posts()):the_post(); ?>

<center>
<?php digg_this_button(); ?>
</center>
  • Now, when a visitor Diggs the article (using the AddThis Widget at the bottom of your post, etc) a Digg Badge will now appear at the top of the post. Dig a post of your own and verify the badge shows up correctly.
  • Now, write good content and see if you get Dugg!

Note: A LOT of people apparently have trouble installing this it appears. Additional installation instructions for this can be found here.

http://blog.patyuen.com/lessons/howto_install_diggthis_plugin/

Also, in order for the link to work, someone (you or otherwise) must click on the link to your post at digg.com in order to send a referring link. Also, be patient - it may take a few hours for the badge to show up, though why that is the case is a mystery to me - the referring link should trigger the badge to show up right away - or so I would think. In practice, be patient.

Digg Badge - MediaWiki

There is a great Digg Extension for MediaWiki available here. Installation is very similar to the steps above for the Wordpress one, there are only a few steps to integrate this on your Wiki.

The instructions are very clear, and you can get the source code for the extension at the link above.

  • Simply download it to your extensions directory (you can also get the code here )
  • Edit Digg.php for the links you want displayed in addition to the Digg Badge
  • Add this include line to your LocalSettings.php.
include('extensions/Digg.php');

You can place the badge anywhere in the body of a page and float left or right. A sample is at the top of this page.

 <digg />
or
 <digg>left</digg> 

Setting up Widgets in MediaWiki

First, you have to enable widgets for Mediawiki, then install the AddThis or other widget.

  • Enable MediaWiki widgets following directions at:

http://www.mediawiki.org/wiki/Extension:Widget

Follow all directions closely, you will need to ensure the extensions/Widgets/compiled_templates/ directory is writable by the web server, and you will likely need to add the following line to you LocalSettings.php

$wgGroupPermissions['sysop']['editwidgets'] = true;

  • If a widget does not show up, you may need to purge the page: add ?action=purge to the url to refresh it from the MediaWiki cache

AddThis Widget - Mediawiki

Update: It looks like a much better MediaWiki widget is Social_Bookmarking rather than this AddThis widget. They both use the AddThis Button - however, I could not get the AddThis widget to work correctly. The mouseover did not work and there was no pop up window either - essentially it did nothing.

The AddThis Widget requires setting up Widgets in MediWiki, however I believe the Social Bookmarking Extension does NOT, and it is very simple to use.

The next section talks specifically about the MediaWiki Social_Bookmarking Extension - both are options.

Here are two example of calling the AddThis widget:

Short and Sweet:

 {{#widget:AddThis|addthis_pub='Your_ID'}} 

Full Options

{{#widget:AddThis
|page_name={{PAGENAME}}
|page_url={{fullurl:{{PAGENAME}}}}
|account_id=Your_ID
|logo_url=
|logo_background=FFFFFF
|logo_color=FFFFFF
|brand=My Wiki
|options=favorites, email, digg, delicious, more
|offset_top=0
|offset_left=0
}}

Social Bookmarking Extension - Mediawiki

Installing this is very straight forward. This extension will place two objects at the end of every page - see them at the bottom of this page. One is an AddThis button, with a working mouseover drop down which is nice. The other is a Socialmarker.com button. If you only want one you can edit the code to eliminate the other easily.

It would be better in my opinion if the buttons were at the top of every page, rather than the bottom but I've yet to figure out how to make that happen - if I do so I will update the fix.

Installation instructions can be found here and consists of just three steps:

  • Download the extension code (cut and paste it.)
  • Put it into bookmark.php in your extensions directory
  • Include it in LocalSettings.php with the line
require_once("extensions/bookmark.php");

Note that if you want to use your AddThis account to track the bookmarks with, just change this line in bookmark.php to include your AddThis.com account name, such as:

        $out->mBodytext .='addthis_pub    = \'YourName\';';

Use this format exactly as is, including all ' and \ characters, etc.

Widget Troubleshooting

  • Are you running an ancient version of MediaWiki that does not support widgets? Check your special:version page and Special:ExtensionDistributor/ParserFunctions and see. This will also show Extension handler information, etc.

Standalone AddThis Button

These notes are for my own AddThis button, but you can see the code for how it works

To get code for a standalone AddThis button you can use on any web page you like, and create an account to track bookmarks created with it, just goto http://www.addthis.com

To use the AddThis Button on webpages, use either of the following.

Button only:

<!-- AddThis Button BEGIN -->
<a href="http://www.addthis.com/bookmark.php" onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this);" target="_blank"><img src="http://s7.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="Bookmark and Share" /></a> <script type="text/javascript">var addthis_pub = 'LewsTherin';</script><script type="text/javascript" src="http://s7.addthis.com/js/widget.php?v=10"></script>  
<!-- AddThis Button END -->


Drop down button:

<!-- AddThis Button BEGIN -->
<script type="text/javascript">addthis_pub  = 'LewsTherin';</script>
<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<!-- AddThis Button END -->


The below snipit comes from the MediaWiki page on widgets for AddThis: http://www.mediawikiwidgets.org/AddThis

<img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="" />

<script type="text/javascript"> addthis_pub = 'LewsTherin'; addthis_logo = ; addthis_logo_color = 'FFFFFF'; addthis_logo_background = 'FFFFFF'; addthis_brand = 'My Wiki'; addthis_options = 'favorites, email, digg, delicious, more'; addthis_offset_top = '0'; addthis_offset_left = '0';

</script><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>


Personal tools