<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>msafi.com &#187; WordPress</title>
	<atom:link href="http://msafi.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://msafi.com</link>
	<description>The friendly blog of MK Safi</description>
	<lastBuildDate>Wed, 28 Jul 2010 22:16:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Clean Your WordPress Sidebar to Improve Navigation and SEO!</title>
		<link>http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/</link>
		<comments>http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 18:01:23 +0000</pubDate>
		<dc:creator>MK</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Blog Structure]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Sidebar]]></category>

		<guid isPermaLink="false">http://msafi.com/?p=776</guid>
		<description><![CDATA[Most people just accept the default, out-of-box layout of blogs even though they know it is not optimal for the nature of their blog. I&#8217;m not the first to say that blog navigation is a nightmare. Why is that? The main problem with blog navigation is that the content is not interlinked properly. That&#8217;s especially [...]


Related posts:<ol><li><a href='http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/' rel='bookmark' title='Permanent Link: Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar'>Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar</a></li>
<li><a href='http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/' rel='bookmark' title='Permanent Link: Give Posts Their Own Sidebar in WordPress'>Give Posts Their Own Sidebar in WordPress</a></li>
<li><a href='http://msafi.com/sensible-use-of-tags-in-a-wordpress-blog/' rel='bookmark' title='Permanent Link: Sensible Use of &#8220;Tags&#8221; in a WordPress Blog'>Sensible Use of &#8220;Tags&#8221; in a WordPress Blog</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-796 noborder" title="wordpress" src="http://msafi.com/home5/mohamme3/public_html/msaficom/wp-content/uploads/2010/01/wordpress.jpg" alt="" width="126" height="119" />Most people just accept the default, out-of-box layout of blogs even though they know it is not optimal for the nature of their blog. I&#8217;m not the first to say that blog navigation is a nightmare.</p>
<p>Why is that?</p>
<p>The main problem with blog navigation is that the content is not interlinked properly. That&#8217;s especially true for generic blogs that aren&#8217;t about one single topic.</p>
<p>When a visitor lands on your generic blog, they&#8217;re probably interested in only one of the topics that you cover. Say that topic is dogs. Even though all of your dog posts are grouped by &#8220;tags&#8221; and &#8220;categories&#8221;, your blog sidebar is probably distracting the visitor with links to other unrelated content about cycling, rock climbing or whatever else you write about.</p>
<p>Don&#8217;t distract your readers.</p>
<p>Give your readers <strong>only</strong> what they&#8217;re interested in at that moment and help them find more of it. Doing that will make your visitors stick around longer, browse more pages, and even improve your SEO!</p>
<p>Here&#8217;s how you can achieve that.<span id="more-776"></span></p>
<h2>Clean Up Your Sidebars</h2>
<p>On your <strong>post pages</strong>, you don&#8217;t have to tell the reader about all the categories and tags that you write about. Why would you clutter your sidebar with such information?</p>
<p>A list of categories and a tag cloud are useful information on the <strong>homepage</strong> because they give your reader an overview of the things that you write about. So, you can put those on the sidebar of the homepage, but not the sidebar of posts pages.</p>
<p>The problem is that most WordPress themes don&#8217;t separate the site-wide sidebar from the post sidebar. It is, however, essential to have a separate sidebar for posts if you&#8217;re serious about improving the navigation and layout of your blog. If your theme has a single sidebar for everything, read this post to learn how to <a href="http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/">give your posts their own sidebar</a>.</p>
<h2>Ideas for Relevant Content to Put on Your Posts Sidebar</h2>
<p>The more a Web page is focused on a single topic and the more links to other related Web pages it has, the more search engine optimization weight it&#8217;ll carry for that topic. Making your sidebar relevant to the topic of the post itself will have huge benefits for your blog. Here are some ideas of the relevant content put on your sidebar:</p>
<ul>
<li>Related links to other posts on the same topic on your blog</li>
<li>A list of categories that the post belongs to</li>
<li>A list of tags that the post belongs to</li>
<li>RSS feed for the categories and tags that the post belongs to</li>
</ul>
<h2>Use a Related Posts Plugin</h2>
<p>Perhaps the best thing you could do to improve the navigation of your blog is to use a related posts plugin. The most popular plugin for this function is <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/">Yet Another Related Posts Plugin</a> (YARPP).</p>
<p>Read this post to learn how you can <a href="http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/">put links to related posts on your sidebar using YARPP</a>.</p>
<p>I hope you found these tips helpful. If you have any questions, comments, or suggestions on what else can be done to improve navigation, post them below! <img src='http://msafi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>


<p>Related posts:<ol><li><a href='http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/' rel='bookmark' title='Permanent Link: Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar'>Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar</a></li>
<li><a href='http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/' rel='bookmark' title='Permanent Link: Give Posts Their Own Sidebar in WordPress'>Give Posts Their Own Sidebar in WordPress</a></li>
<li><a href='http://msafi.com/sensible-use-of-tags-in-a-wordpress-blog/' rel='bookmark' title='Permanent Link: Sensible Use of &#8220;Tags&#8221; in a WordPress Blog'>Sensible Use of &#8220;Tags&#8221; in a WordPress Blog</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Give Posts Their Own Sidebar in WordPress</title>
		<link>http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/</link>
		<comments>http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 09:11:43 +0000</pubDate>
		<dc:creator>MK</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Sidebar]]></category>

		<guid isPermaLink="false">http://msafi.com/?p=811</guid>
		<description><![CDATA[One way to improve the structure of your WordPress blog is to create multiple sidebars. More specifically, make the content of the sidebar that appears on post pages different from the content that appear on the site-wide sidebar. In this tutorial, I will show you the proper way to create a dynamic sidebar that is [...]


Related posts:<ol><li><a href='http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/' rel='bookmark' title='Permanent Link: Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar'>Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar</a></li>
<li><a href='http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/' rel='bookmark' title='Permanent Link: Clean Your WordPress Sidebar to Improve Navigation and SEO!'>Clean Your WordPress Sidebar to Improve Navigation and SEO!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One way to improve the structure of your WordPress blog is to create multiple sidebars. More specifically, make the content of the sidebar that appears on post pages different from the content that appear on the site-wide sidebar.</p>
<p>In this tutorial, I will show you the proper way to create a dynamic sidebar that is solely for posts.<span id="more-811"></span></p>
<h2>Create a PHP File for the Sidebar</h2>
<p>The first step is creating the actual PHP template file for the sidebar. Name the file <code>sidebar-post.php</code>. Put this file in the same folder where <code>sidebar.php</code> exists. Now copy the content of <code>sidebar.php</code> to the new file.</p>
<p>My <code>sidebar.php</code> looks like this:</p>
<pre class="brush: php; gutter: true;">&lt;?php global $vigilance; ?&gt;
  &lt;div id=&quot;sidebar&quot;&gt;
    &lt;?php if ($vigilance-&gt;sideimgState() == 'hide') : else : ?&gt;
      &lt;?php if (is_file(STYLESHEETPATH . '/sidebar-imagebox.php')) include(STYLESHEETPATH . '/sidebar-imagebox.php'); else include(TEMPLATEPATH . '/sidebar-imagebox.php'); ?&gt;
    &lt;?php endif; ?&gt;
    &lt;?php if ($vigilance-&gt;feedState() == 'disabled') : else : ?&gt;
      &lt;?php if (is_file(STYLESHEETPATH . '/sidebar-feedbox.php')) include(STYLESHEETPATH . '/sidebar-feedbox.php'); else include(TEMPLATEPATH . '/sidebar-feedbox.php'); ?&gt;
    &lt;?php endif; ?&gt;
    &lt;ul&gt;
      &lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('right_sidebar') ) : ?&gt;
        &lt;li class=&quot;widget widget_recent_entries&quot;&gt;
          &lt;h2 class=&quot;widgettitle&quot;&gt;&lt;?php _e('Recent Articles'); ?&gt;&lt;/h2&gt;
          &lt;ul&gt;
            &lt;?php $side_posts = get_posts('numberposts=10'); foreach($side_posts as $post) : ?&gt;
            &lt;li&gt;&lt;a href= &quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
            &lt;?php endforeach; ?&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
      &lt;?php endif; ?&gt;
    &lt;/ul&gt;
    &lt;?php if (is_active_sidebar('left_sidebar')) echo '&lt;ul class=&quot;thin-sidebar spad&quot;&gt;';?&gt;
      &lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('left_sidebar') ) : endif; ?&gt;
    &lt;?php if (is_active_sidebar('left_sidebar')) echo '&lt;/ul&gt;'; ?&gt;
    &lt;?php if (is_active_sidebar('right_sidebar')) echo '&lt;ul class=&quot;thin-sidebar&quot;&gt;'; ?&gt;
      &lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('right_sidebar') ) : endif; ?&gt;
    &lt;?php if (is_active_sidebar('right_sidebar')) echo '&lt;/ul&gt;' ;?&gt;
  &lt;/div&gt;&lt;!--end sidebar--&gt;</pre>
<p>Unless you&#8217;re using the same theme that I copied this code from, <a href="http://themes.jestro.com/vigilance/">Vigilance</a>, you&#8217;ll most certainly have different code. Look at the code you&#8217;ve copied and find what looks like this:</p>
<pre class="brush: php;">if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('right_sidebar') ) : ?&amp;gt;</pre>
<p>In your new file, <code>sidebar-post.php</code>, you should substitute <code>right_sidebar</code> (or whatever you have) with <code>post_sidebar</code>.</p>
<h2>Register the Dynamic Post Sidebar</h2>
<p>Now that you&#8217;ve created the PHP file for a widget-enabled sidebar, it is time to register this sidebar so that you can add widgets to it. You&#8217;ll have to  look into how your theme registers sidebars. In your theme&#8217;s folder, you should find a file called <code>functions.php</code>. In that file, look for a line that looks like this:</p>
<pre class="brush: php;">if ( function_exists('register_sidebar') ) register_sidebar(array(</pre>
<p>The code in the theme that I&#8217;m using here is this:</p>
<pre class="brush: php;">if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'name'=&gt; __('Right Sidebar', 'vigilance'),
        'id' =&gt; 'right_sidebar',
        'before_widget' =&gt; '&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;',
        'after_widget' =&gt; '&lt;/li&gt;',
        'before_title' =&gt; '&lt;h2 class=&quot;widgettitle&quot;&gt;',
        'after_title' =&gt; '&lt;/h2&gt;',
    ));</pre>
<p>In the code above, you&#8217;d have to substitute <code>Right Sidebar</code> with <code>Post Sidebar</code> and <code>right_sidebar</code> with <code>post_sidebar</code>. Apply the equivalent changes to your own theme&#8217;s code.</p>
<h2>Finally, Call Your New Sidebar from single.php</h2>
<p>In most WordPress themes, a post page is displayed using the <code>single.php</code> template file. This file is where a sidebar gets called on. You&#8217;ll have to edit the line that calls the main sidebar to make it call the new sidebar that you&#8217;ve created above.</p>
<p><code>single.php</code> is located at the main folder of the theme. In your <code>single.php</code>, look for the code <code>get_sidebar();</code> and edit it to <code>get_sidebar('post');</code>.</p>
<p>That&#8217;s it! Now your post pages will display their own separate sidebar. To add widgets to this new sidebar, go to the widgets panel, find the sidebar named &#8220;Post Sidebar&#8221;, and drag widgets to it.</p>
<p>I hope you found this tutorial helpful. If you have any comments, questions, or suggestions, please post them below <img src='http://msafi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>


<p>Related posts:<ol><li><a href='http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/' rel='bookmark' title='Permanent Link: Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar'>Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar</a></li>
<li><a href='http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/' rel='bookmark' title='Permanent Link: Clean Your WordPress Sidebar to Improve Navigation and SEO!'>Clean Your WordPress Sidebar to Improve Navigation and SEO!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar</title>
		<link>http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/</link>
		<comments>http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 09:20:37 +0000</pubDate>
		<dc:creator>MK</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://msafi.com/?p=781</guid>
		<description><![CDATA[YARPP is an essential WordPress plugin because it improves the navigation of your blog and therefore it adds more search engine optimization weight to your pages. Most blogs list links to related posts at the bottom of each post page. Another great place to list related links is in the sidebar. YARPP does come with [...]


Related posts:<ol><li><a href='http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/' rel='bookmark' title='Permanent Link: Clean Your WordPress Sidebar to Improve Navigation and SEO!'>Clean Your WordPress Sidebar to Improve Navigation and SEO!</a></li>
<li><a href='http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/' rel='bookmark' title='Permanent Link: Give Posts Their Own Sidebar in WordPress'>Give Posts Their Own Sidebar in WordPress</a></li>
<li><a href='http://msafi.com/sensible-use-of-tags-in-a-wordpress-blog/' rel='bookmark' title='Permanent Link: Sensible Use of &#8220;Tags&#8221; in a WordPress Blog'>Sensible Use of &#8220;Tags&#8221; in a WordPress Blog</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>YARPP is an essential WordPress plugin because it improves the navigation of your blog and therefore it adds more search engine optimization weight to your pages.</p>
<p>Most blogs list links to related posts at the bottom of each post page. Another great place to list related links is in the sidebar. YARPP does come with a sidebar widget. But as you can see in the <a href="http://wordpress.org/tags/yet-another-related-posts-plugin">plugin&#8217;s forum</a>, many people are having problems with it. Also, it doesn&#8217;t allow you to separate the style and template from the main related posts links. Even the author of the plugin <a href="http://wordpress.org/support/topic/345774?replies=5#post-1330297">has disowned</a> the built-in widget!</p>
<p>What I&#8217;ll show you here is how you can create your own YARPP sidebar widget and give it a different style and template from the main related posts links.<span id="more-781"></span></p>
<h2>PHP Code for the Widget</h2>
<p>Here&#8217;s the entire PHP code for this widget.</p>
<pre class="brush: php;">add_action('widgets_init', create_function('', 'register_widget(&quot;Related_Posts_Widget&quot;);'));
class Related_Posts_Widget extends WP_Widget
{
    function Related_Posts_Widget() {
        parent::WP_Widget(false, $name = 'Related Posts Widget');
    }

    function widget($args, $instance)
    {
		extract($args);
		extract($instance);

		echo	$before_widget;

		echo	related_posts(array('template_file'=&gt;'yarpp-template-widget.php'));

		echo	$after_widget;
    }

    function update($new_instance, $old_instance)
    {
        return $new_instance;
    }
}</pre>
<p>Copy and paste the code above in <code>functions.php</code> in your theme&#8217;s folder. You can now go to &#8220;Appearance&#8221; -&gt; &#8220;Widgets&#8221; and you&#8217;ll see a new widget called &#8220;Related Posts Widget&#8221;. Simply drag it to your sidebar! But wait. Before you do that, you&#8217;ll have to create a template file for the widget.</p>
<h2>Widget Template File</h2>
<p>The template file is mostly made up of the HTML that the plugin will use to display your list of related posts.</p>
<p>For the widget code above to work, you&#8217;ll have to create a new template file and name it: <code>yarpp-template-widget.php</code>. The file should exist with the rest of YARPP template files, which is in the main folder of your theme.</p>
<p>The content of my <code>yarpp-template-widget.php</code><em> </em>look like this:</p>
<pre class="brush: php;">&lt;?php /*
Example template
Author: mitcho (Michael Yoshitaka Erlewine)
*/
?&gt;
&lt;?php if ($related_query-&gt;have_posts()):?&gt;

&lt;h2 class=&quot;widgettitle&quot;&gt;Other Interesting Posts&lt;/h2&gt;
&lt;ul&gt;
	&lt;?php while ($related_query-&gt;have_posts()) : $related_query-&gt;the_post(); ?&gt;
		&lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;!-- (&lt;?php the_score(); ?&gt;)--&gt;&lt;/li&gt;
	&lt;?php endwhile; ?&gt;
&lt;/ul&gt;
&lt;?php endif; ?&gt;</pre>
<p>You&#8217;ll need to know some HTML and PHP to modify the template.</p>
<p>But with this file in place, you can now simply go to the Widgets panel in WordPress admin area, and you&#8217;ll see &#8220;Related Posts Widget&#8221;, which you can add to any sidebar!</p>
<p>I hope you found this tutorial helpful. If you have any questions, comments or suggestions, post them below <img src='http://msafi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>


<p>Related posts:<ol><li><a href='http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/' rel='bookmark' title='Permanent Link: Clean Your WordPress Sidebar to Improve Navigation and SEO!'>Clean Your WordPress Sidebar to Improve Navigation and SEO!</a></li>
<li><a href='http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/' rel='bookmark' title='Permanent Link: Give Posts Their Own Sidebar in WordPress'>Give Posts Their Own Sidebar in WordPress</a></li>
<li><a href='http://msafi.com/sensible-use-of-tags-in-a-wordpress-blog/' rel='bookmark' title='Permanent Link: Sensible Use of &#8220;Tags&#8221; in a WordPress Blog'>Sensible Use of &#8220;Tags&#8221; in a WordPress Blog</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Automatically Create and Cloak Amazon Affiliate Links in WordPress</title>
		<link>http://msafi.com/automatically-create-and-cloak-amazon-affiliate-links-in-wordpress/</link>
		<comments>http://msafi.com/automatically-create-and-cloak-amazon-affiliate-links-in-wordpress/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 15:42:33 +0000</pubDate>
		<dc:creator>MK</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Affiliate Links]]></category>
		<category><![CDATA[Geeky Tips]]></category>
		<category><![CDATA[Internet Marketing]]></category>
		<category><![CDATA[Link Cloaking]]></category>
		<category><![CDATA[Redirection]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://msafi.com/?p=677</guid>
		<description><![CDATA[I have written an article earlier on how to generally cloak and organize affiliate links in WordPress. But in this article I will show you how to setup your WordPress system so that you can easily create and cloak Amazon affiliate links on the fly. The end results will be something like this. To link [...]


Related posts:<ol><li><a href='http://msafi.com/create-and-cloak-affiliate-links-in-wordpress/' rel='bookmark' title='Permanent Link: Best Way to Organize and Cloak Affiliate Links in WordPress'>Best Way to Organize and Cloak Affiliate Links in WordPress</a></li>
<li><a href='http://msafi.com/turn-keywords-into-links-with-word-2-cash/' rel='bookmark' title='Permanent Link: Turn Keywords into Links with Word 2 Cash'>Turn Keywords into Links with Word 2 Cash</a></li>
<li><a href='http://msafi.com/squeezing-the-seo-juice-out-of-your-affiliates/' rel='bookmark' title='Permanent Link: Squeezing the SEO Juice Out of Your Affiliates'>Squeezing the SEO Juice Out of Your Affiliates</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-681" title="amazon-associates-links" src="http://msafi.com/home5/mohamme3/public_html/msaficom/wp-content/uploads/2009/12/amazon-associates-links.jpg" alt="" width="200" height="59" />I have written an article earlier on how to generally <a href="http://msafi.com/create-and-cloak-affiliate-links-in-wordpress/">cloak and organize affiliate links in WordPress</a>. But in this article I will show you how to setup your WordPress system so that you can easily create and cloak Amazon affiliate links on the fly.</p>
<p>The end results will be something like this. To link to an Amazon product, you would simply put</p>
<p><span style="background-color: #ffffcc;">http://yourdomainname.com/amazon/[ASIN]</span></p>
<p>And this unique link of yours would forward to Amazon&#8217;s product and credit you for any sales. As you should&#8217;ve guessed, to link to a different product in Amazon&#8217;s catalog, you just change the <a href="http://en.wikipedia.org/wiki/Amazon_Standard_Identification_Number">ASIN</a> number in the link above.</p>
<p>This should make it very convenient for you not only to link to Amazon, but also cloak your links effectively.</p>
<p>So, let me show you how to set this up&#8230;</p>
<p><span id="more-677"></span></p>
<p>First, you need to <a href="http://wordpress.org/extend/plugins/redirection/installation/">install</a> the plugin <a href="http://wordpress.org/extend/plugins/redirection/">Redirection</a>. Through this plugin, you can setup automatic URL redirects.</p>
<p>Now, in your WordPress admin area, go to &#8220;Tools&#8221; and then &#8220;Redirection&#8221;.</p>
<p>You&#8217;ll see a section with the heading <strong>Add new redirection</strong>. Enter the following values in the form below it:</p>
<ul>
<li>In Source URL, enter <span style="background-color: #ffffcc;">/amazon/([^/]*)</span></li>
<li>In Target URL, enter <span style="background-color: #ffffcc;">http://www.amazon.com/dp/$1/[Your Amazon Associate ID]</span></li>
<li>Make sure that you check the box that says <em>Regular Expression</em></li>
<li>Click save, and you&#8217;re done!</li>
</ul>
<p>Now, your blog will automatically direct visitors to Amazon products. All you have to do is supply the ASIN number like in the example above.</p>
<p>If you want more details or if you want to know how to do the same for your ClickBank links, check out my <a href="http://msafi.com/create-and-cloak-affiliate-links-in-wordpress/">earlier article</a>.</p>
<p>If you have any questions or if anything isn&#8217;t clear, feel free to ask in the comments.</p>
<p>I may create a WordPress plugin to make this even easier. Stay tuned for that.</p>


<p>Related posts:<ol><li><a href='http://msafi.com/create-and-cloak-affiliate-links-in-wordpress/' rel='bookmark' title='Permanent Link: Best Way to Organize and Cloak Affiliate Links in WordPress'>Best Way to Organize and Cloak Affiliate Links in WordPress</a></li>
<li><a href='http://msafi.com/turn-keywords-into-links-with-word-2-cash/' rel='bookmark' title='Permanent Link: Turn Keywords into Links with Word 2 Cash'>Turn Keywords into Links with Word 2 Cash</a></li>
<li><a href='http://msafi.com/squeezing-the-seo-juice-out-of-your-affiliates/' rel='bookmark' title='Permanent Link: Squeezing the SEO Juice Out of Your Affiliates'>Squeezing the SEO Juice Out of Your Affiliates</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://msafi.com/automatically-create-and-cloak-amazon-affiliate-links-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sensible Use of &#8220;Tags&#8221; in a WordPress Blog</title>
		<link>http://msafi.com/sensible-use-of-tags-in-a-wordpress-blog/</link>
		<comments>http://msafi.com/sensible-use-of-tags-in-a-wordpress-blog/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 12:49:42 +0000</pubDate>
		<dc:creator>MK</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://msafi.com/?p=429</guid>
		<description><![CDATA[In WordPress there are categories and then there are tags. I wanted to keep my posts organized, so I did some research to try to understand the difference between tags and categories. After reading some explanations, I still wasn&#8217;t satisfied. I couldn&#8217;t find a logical distinction between categories and tags. So here&#8217;s what I decided [...]


Related posts:<ol><li><a href='http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/' rel='bookmark' title='Permanent Link: Clean Your WordPress Sidebar to Improve Navigation and SEO!'>Clean Your WordPress Sidebar to Improve Navigation and SEO!</a></li>
<li><a href='http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/' rel='bookmark' title='Permanent Link: Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar'>Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar</a></li>
<li><a href='http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/' rel='bookmark' title='Permanent Link: Give Posts Their Own Sidebar in WordPress'>Give Posts Their Own Sidebar in WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-450 noborder" title="wpt026" src="http://msafi.com/home5/mohamme3/public_html/msaficom/wp-content/uploads/2009/11/wpt026.jpg" alt="wpt026" width="129" height="170" />In WordPress there are categories and then there are tags. I wanted to keep my posts organized, so I did some research to try to understand the difference between tags and categories.</p>
<p>After reading <a href="http://lorelle.wordpress.com/2005/09/09/categories-versus-tags-whats-the-difference-and-which-one/">some explanations</a>, I still wasn&#8217;t satisfied. I couldn&#8217;t find a logical distinction between categories and tags.</p>
<p>So here&#8217;s what I decided to do&#8230;<span id="more-429"></span></p>
<h2>Why it&#8217;s enough to just use tags and ignore categories</h2>
<p>Categories and tags are essentially the same thing. Using both to organize posts is an overkill. Just use one &#8212; the more versatile. That would be <em>tags</em>. As for the categories, I&#8217;m letting all my posts fall under <em>Uncategorized</em>.</p>
<p>Tags are more concise and descriptive than categories. And after some time, the <a href="http://en.wikipedia.org/wiki/Tag_cloud">tag cloud</a> gives very accurate visual depiction of the topics covered on a blog. The tag cloud tells what a blog is (mostly) about.</p>
<p>But to get the most out of tags and the tag cloud, some customization is required.</p>
<h2>Theme customization</h2>
<p>Themes come pre-equipped to handle categories. The theme I use on this website, showed the categories under each post. It showed the tags at the top (for SEO purposes, supposedly). I removed the categories and brought the tags to the bottom, where categories were. I renamed tags to <em>Topics</em>, as you can see at the end of each post.</p>
<p>Obviously, this required editing of the theme files.</p>
<h2>Creating a Usable Tag Cloud Widget</h2>
<p>The default WordPress tag cloud is ugly. That&#8217;s why very few websites use it. That&#8217;s a shame because like a said, a tag cloud can be very useful. That&#8217;s why I took some time to fix the tag cloud on this website and make a real use of it.</p>
<p>Here&#8217;s a sample of what I created</p>
<p><div id="attachment_849" class="wp-caption aligncenter" style="width: 347px"><img class="size-full wp-image-849" title="tag-cloud" src="http://msafi.com/home5/mohamme3/public_html/msaficom/wp-content/uploads/2009/11/tag-cloud.jpg" alt="" width="337" height="218" /><p class="wp-caption-text">Custom WordPress Tag Cloud</p></div></p>
<p>Most popular topics appear first and with the largest font size. Then topics that are not covered as much appear later in the list and with smaller font size. Of course, this tag cloud changes as the variation of topics on the blog changes. After all, that&#8217;s the nature of a tag cloud.</p>
<p>One would think creating a tag cloud like that should be simple, right? Well, not if you want the topics to be comma-separated like mine are.</p>
<h3>My custom made tag cloud widget</h3>
<p>This tag cloud has the following features:</p>
<ul>
<li>Tags are comma separated</li>
<li>Most popular tags appear first in the list</li>
</ul>
<p>Here&#8217;s the code for the widget:</p>
<pre class="brush: php;">aadd_action('widgets_init', create_function('', 'register_widget(&quot;MX_Tags_Widget&quot;);'));
class MX_Tags_Widget extends WP_Widget
{
    function MX_Tags_Widget() {
        parent::WP_Widget(false, $name = 'MX Tag Cloud');
    }

    function widget($args, $instance)
    {
		extract($args);
		extract($instance);

		echo	$before_widget;

		// My widget says, &quot;This Website is (Mostly) About&quot;.
		// You can change that to anything you want.
		echo '&lt;h2 class=&quot;widgettitle&quot;&gt;This Website is (Mostly) About&lt;/h2&gt;';

		// You can change the behavior of this tag cloud widget
		// by passing different parameters
		// See a list of possible parameters at
		// http://codex.wordpress.org/Template_Tags/wp_tag_cloud
		$tags = wp_tag_cloud('echo=0&amp;format=array&amp;largest=1.4&amp;smallest=1&amp;unit=em&amp;orderby=count&amp;order=DESC&amp;number=20');

		// This is what separates the tags by commas.
		// You can change the separator to any other character
		// The separater is wrapped in a designated class
		// to make CSS styling possible.
		$tags = implode('&lt;span class=&quot;tag-separator&quot;&gt;,&lt;/span&gt; ', $tags);
		echo $tags;

		echo	$after_widget;
    }

    function update($new_instance, $old_instance)
    {
        return $new_instance;
    }
}</pre>
<p>You can simply copy this code to the <em>functions.php </em>file in your theme, and it will create a tag cloud widget which you can add to your sidebar from WordPress&#8217;s widgets menu.</p>
<p>Make sure that you read the comments within the code. They provide more tips on customization.</p>
<h2>More to come&#8230;</h2>
<p>I think this tag cloud is already better than a simple list of categories, especially for a personal blog like this. But it could be improved even further.</p>
<p>For example, now users can click on a tag and see all the posts which belong to that tag. Wouldn&#8217;t be cool if they can select more than one tag and pull all posts that belong to the selected tags? That would require more customization and coding. I&#8217;ll post about it if I ever get to it <img src='http://msafi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>


<p>Related posts:<ol><li><a href='http://msafi.com/clean-your-wordpress-sidebar-to-improve-navigation-and-seo/' rel='bookmark' title='Permanent Link: Clean Your WordPress Sidebar to Improve Navigation and SEO!'>Clean Your WordPress Sidebar to Improve Navigation and SEO!</a></li>
<li><a href='http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/' rel='bookmark' title='Permanent Link: Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar'>Fix Yet Another Related Posts Plugin (YARPP) Widget and Add it to the Sidebar</a></li>
<li><a href='http://msafi.com/how-to-make-posts-have-different-sidebar-from-the-rest-of-wordpress-blog/' rel='bookmark' title='Permanent Link: Give Posts Their Own Sidebar in WordPress'>Give Posts Their Own Sidebar in WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://msafi.com/sensible-use-of-tags-in-a-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Best Way to Organize and Cloak Affiliate Links in WordPress</title>
		<link>http://msafi.com/create-and-cloak-affiliate-links-in-wordpress/</link>
		<comments>http://msafi.com/create-and-cloak-affiliate-links-in-wordpress/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 00:09:17 +0000</pubDate>
		<dc:creator>MK</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Affiliate Links]]></category>
		<category><![CDATA[ClickBank]]></category>
		<category><![CDATA[Geeky Tips]]></category>
		<category><![CDATA[Internet Marketing]]></category>
		<category><![CDATA[Link Cloaking]]></category>
		<category><![CDATA[Redirection]]></category>
		<category><![CDATA[Robots.txt]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://msafi.com/?p=205</guid>
		<description><![CDATA[If you currently have or plan to have plenty of affiliate links on your WordPress based website, you should have a way to easily track and manage these affiliate links. You want to know how many clicks each link received and you want to be able to edit and change the affiliate link without having [...]


Related posts:<ol><li><a href='http://msafi.com/automatically-create-and-cloak-amazon-affiliate-links-in-wordpress/' rel='bookmark' title='Permanent Link: Automatically Create and Cloak Amazon Affiliate Links in WordPress'>Automatically Create and Cloak Amazon Affiliate Links in WordPress</a></li>
<li><a href='http://msafi.com/squeezing-the-seo-juice-out-of-your-affiliates/' rel='bookmark' title='Permanent Link: Squeezing the SEO Juice Out of Your Affiliates'>Squeezing the SEO Juice Out of Your Affiliates</a></li>
<li><a href='http://msafi.com/great-networks-for-software-affiliates-and-vendors/' rel='bookmark' title='Permanent Link: Great Networks for Software Affiliates and Vendors'>Great Networks for Software Affiliates and Vendors</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-363 noborder" title="organizelinks" src="http://msafi.com/home5/mohamme3/public_html/msaficom/wp-content/uploads/2009/10/organizelinks.gif" alt="organizelinks" width="200" height="146" /></p>
<p>If you currently have or plan to have plenty of affiliate links on your WordPress based website, you should have a way to easily track and manage these affiliate links. You want to know how many clicks each link received and you want to be able to edit and change the affiliate link without having to revisit and change old content.</p>
<p>And to keep your website clean and organized in the eyes of search engines, there are a few things that will need tweaking.</p>
<p>Here&#8217;s how I create, manage and cloak my affiliate links.<span id="more-205"></span></p>
<h2 style="text-align: left;">Using Redirection</h2>
<p><a href="http://wordpress.org/extend/plugins/redirection/">Redirection</a> is a WordPress plugin that is made by <a href="http://urbangiraffe.com/">John Godley</a>, who works for <a href="http://www.automattic.com">Automattic</a>, the company behind WordPress. Redirection helps you manage your blog URLs. Using Redirection, you could create a link like <span style="background-color: #fff9dc;">http://msafi.com/gotogoogle/</span> and set that link to forward to <span style="background-color: #fff9dc;">http://google.com</span>. Similarly, you could put all your affiliate forwarders in a virtual directory like:</p>
<ul>
<li>http://msafi.com/affiliate/product1/</li>
<li>http://msafi.com/affiliate/product2/</li>
<li>http://msafi.com/affiliate/product3/</li>
<li>and so on&#8230;</li>
</ul>
<p>Most people don&#8217;t use <span style="background-color: #fff9dc;"><em>affiliate</em></span> for the directory name, though. They use <em><span style="background-color: #fff9dc;">goto</span> </em>or <span style="background-color: #fff9dc;"><em>visit</em></span>. Or like on this website, I simply use <em><span style="background-color: #fff9dc;">a</span>.</em></p>
<p>Redirection also allows you to group related URL redirections together. So, you could create a group, name it Affiliate Links and put all your affiliate links there.</p>
<h2>Create an affiliate link in Redirection</h2>
<p>Once you have Redirection installed</p>
<ol>
<li>Click on <span style="background-color: #fff9dc;">Groups</span> in the top left corner</li>
<li>At the bottom of the page, you&#8217;ll see <span style="background-color: #fff9dc;">Add Group</span>. Enter <span style="background-color: #fff9dc;">Affiliate Links</span> in the textbox, and click <span style="background-color: #fff9dc;">Add</span>.</li>
<li>Click on your newly added group, <span style="background-color: #fff9dc;">Affiliate Links</span></li>
<li>In the source URL, put something like <span style="background-color: #fff9dc;"> </span><span style="background-color: #fff9dc;"> </span><span style="background-color: #fff9dc;">/visit/product-xyz/</span> (don&#8217;t include your domain name, <em>http://ursite.com</em>)</li>
<li>For <span style="background-color: #fff9dc;">Match</span>, select <span style="background-color: #fff9dc;">URL only</span></li>
<li>For <span style="background-color: #fff9dc;">Action</span>, select <span style="background-color: #fff9dc;">Redirect to URL</span></li>
<li>Leave <span style="background-color: #fff9dc;">Regular expression</span> unchecked</li>
<li>In <span style="background-color: #fff9dc;">Target URL</span>, put your affiliate link</li>
</ol>
<p>That&#8217;s it. You&#8217;ve added your first affiliate link to Redirection.</p>
<p>Now whenever you want to link to Product XYZ, use http://ursite.com/visit/product-xyz/. It&#8217;s even easier to remember.</p>
<p>Redirection also gives you the number of hits each link received. So, if you&#8217;re putting your links in relevant places and getting huge volumes of clicks but maybe no sales, you&#8217;ll know something is going on&#8230;</p>
<h2>Cool tip: get Redirection to automatically create ClickBank affiliate links for you!</h2>
<p>If you promote products for ClickBank, here&#8217;s a cool tip that you&#8217;ll find very useful.</p>
<p>All of ClickBank&#8217;s links have the following structure</p>
<p><code>http://<span style="color: #ff0000;"><strong>YourClickBankID</strong></span>.<span style="color: #0000ff;"><strong>VendorClickBankID</strong></span>.hop.clickbank.net</code></p>
<p>You can tell Redirection to automatically fill in the VendorClickBankID field for you based on a value that you provide in your URL. Like:</p>
<p><span style="background-color: #fff9dc;">http://ursite.com/cb/<strong>vendorx311</strong>/ </span></p>
<p>automatically redirects to</p>
<p><span style="background-color: #fff9dc;">http://yourClickBankID.<strong>vendorx311</strong>.hop.clickbank.net</span></p>
<p>and</p>
<p><span style="background-color: #fff9dc;">http://ursite.com/cb/<strong>sumvendor2</strong>/</span></p>
<p>automatically redirects to</p>
<p><span style="background-color: #fff9dc;">http://yourClickBankID.<strong>sumvendor2</strong>.hop.clickbank.net</span></p>
<p>&#8230;and so on&#8230;</p>
<p>Here&#8217;s how you do this in Redirection:</p>
<ol>
<li>In the Source URL, enter <span style="background-color: #fff9dc;">/cb/([^/]*)</span></li>
<li>In Target URL, enter <span style="background-color: #fff9dc;">http://yourClickBankID.$1.hop.clickbank.net</span></li>
<li>Make sure <span style="background-color: #fff9dc;">Regular expression</span> is checked</li>
<li>Match should be set to <span style="background-color: #fff9dc;">URL only</span></li>
<li>Action should be set to <span style="background-color: #fff9dc;">Redirect URL</span></li>
</ol>
<p>I have done this on my website here at <a href="http://msafi.com">msafi.com</a>. So, now I can simply give out a link like <a rel="nofollow" href="http://msafi.com/cb/4idiots/">http://msafi.com/cb/4idiots/</a>. This will redirect to <a rel="nofollow" href="http://mksafi.4idiots.clickbank.net">http://mksafi.4idiots.clickbank.net</a>, which is the landing sales page for the product sold by <em>4idiots </em>ClickBank vendor. You can replace <em>4idiots</em> with any ClickBank vendor ID and it will still work.</p>
<p>Pretty cool isn&#8217;t it?</p>
<p>Perhaps a similar trick can be done to automate link cloaking and management for Amazon and Commission Junction, but I&#8217;ll have to look into that.</p>
<p>For now, let&#8217;s look into optimizing your affiliate links so that Google will not have trouble with them&#8230;</p>
<h2>Helping Google not trip over your affiliate links</h2>
<p>Now that you have a convenient and easy way to create and organize affiliate links, I&#8217;m gonna show you how to make sure that Google will not discriminate against your blog as a result of affiliate links.</p>
<p>First, whenever you add an affiliate link as anchor text make sure that you include a rel=&#8221;nofollow&#8221; attribute in the anchor tag. That is</p>
<p>Bad: <span style="background-color: #fff9dc;">&lt;a href=&#8221;http://ursite.com/visit/product-xyz/&#8221;&gt;Product XYZ&lt;/a&gt;</span></p>
<p>Good: <span style="background-color: #fff9dc;">&lt;a href=&#8221;http://ursite.com/visit/product-xyz/&#8221; rel=&#8221;nofollow&#8221;&gt;Product XYZ&lt;/a&gt;</span></p>
<p>If you want to automate the creation of anchor text links in WordPress, check out the plugin I created: <a href="http://msafi.com/wordpress-plugins/turn-keywords-into-links-with-word-2-cash/">Word 2 Cash</a>.</p>
<p>Second, use <a href="http://www.robotstxt.org">robots.txt</a> to disallow Google (and other search engines) from accessing your virtual affiliate links URL directories. Your affiliate link directories are /visit/, /cb/ and whatever else you may have created.</p>
<p>In your robots.txt file add lines like:</p>
<p><code>Disallow: /visit/*<br />
Disallow: /cb/*</code></p>
<p>Do the same for any other affiliate link directory you have.</p>
<p>This will help Google index your website in a clean way and hopefully minimize discrimination against your outbound links.</p>
<p style="text-align: left;">That&#8217;s all there is to it. You now have a great way to create and manage your affiliate links. Just one last thing before you go.</p>
<h3>Reducing Redirection database size</h3>
<p>Redirection keeps a record of every redirect it makes. It stores these records in your database. If you&#8217;re gonna be using the plugin the way I described in this post, your records can build up and take a lot of space pretty quickly. What you want to do is set the records to expire after some time, say 30 days. To do that:</p>
<ol>
<li>go to Redirection&#8217;s admin page</li>
<li>Click on <span style="background-color: #fff9dc;">Options</span></li>
<li>In the <span style="background-color: #fff9dc;">Expire Logs</span> field, enter 30 and click Save.</li>
</ol>
<p>Aaaaaaand you&#8217;re done!</p>


<p>Related posts:<ol><li><a href='http://msafi.com/automatically-create-and-cloak-amazon-affiliate-links-in-wordpress/' rel='bookmark' title='Permanent Link: Automatically Create and Cloak Amazon Affiliate Links in WordPress'>Automatically Create and Cloak Amazon Affiliate Links in WordPress</a></li>
<li><a href='http://msafi.com/squeezing-the-seo-juice-out-of-your-affiliates/' rel='bookmark' title='Permanent Link: Squeezing the SEO Juice Out of Your Affiliates'>Squeezing the SEO Juice Out of Your Affiliates</a></li>
<li><a href='http://msafi.com/great-networks-for-software-affiliates-and-vendors/' rel='bookmark' title='Permanent Link: Great Networks for Software Affiliates and Vendors'>Great Networks for Software Affiliates and Vendors</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://msafi.com/create-and-cloak-affiliate-links-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
