<?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>Weblog of Michael Cutler &#187; Hacks</title>
	<atom:link href="http://blog.lobstertechnology.com/category/wordpress/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lobstertechnology.com</link>
	<description>"I felt a great disturbance in the Force, as if millions of peers suddenly cried out in terror and were suddenly silenced."</description>
	<lastBuildDate>Tue, 17 Oct 2006 14:40:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Hack &#187; Reading MySQL username &amp; password from wp-config.php</title>
		<link>http://blog.lobstertechnology.com/2006/01/24/wordpress-hack-reading-mysql-username-and-password/</link>
		<comments>http://blog.lobstertechnology.com/2006/01/24/wordpress-hack-reading-mysql-username-and-password/#comments</comments>
		<pubDate>Tue, 24 Jan 2006 13:36:50 +0000</pubDate>
		<dc:creator>Michael Cutler</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.lobstertechnology.com/2006/01/24/wordpress-hack-reading-mysql-username-and-password/</guid>
		<description><![CDATA[A few months ago I was working on a prototype Wordpress plug-in that generated graphs using GNUPlot. To do this it had another script embedded at the end of the file which dumped data from the Wordpress database and produced graphs as images for the output.
The problem is that the GNUPlot section of the script [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I was working on a prototype Wordpress plug-in that generated graphs using GNUPlot. To do this it had another script embedded at the end of the file which dumped data from the Wordpress database and produced graphs as images for the output.</p>
<p>The problem is that the GNUPlot section of the script is referred to directly my an "img" XHTML tag and is not loaded by Wordpress itself; it does not have access to the Wordpress database configuration.</p>
<p>To workaround this I wrote the following section of code, it opens the "wp-config.php" file and parses out anything matching the pattern "define( name, value )" into a $config variable. Immediately afterwards it attempts to connect to MySQL using these details.</p>
<p>Bit of a hack, but it was the only nice way I could see to do it and keep the plug-in simple &#038; configuration free.</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$config</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// HACK Read wp-config.php for the Database username/password, including it wouldnt work</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#0000FF;">$handle</span> = <a href="http://www.php.net/fopen"><span style="color:#000066;">fopen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">"../../wp-config.php"</span>, <span style="color:#FF0000;">"r"</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$handle</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$content</span> = <span style="color:#FF0000;">''</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span> !<a href="http://www.php.net/feof"><span style="color:#000066;">feof</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$handle</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$content</span> .= <a href="http://www.php.net/fread"><span style="color:#000066;">fread</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$handle</span>, <span style="color:#CC66CC;color:#800000;">1024</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/fclose"><span style="color:#000066;">fclose</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$handle</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/preg_match_all"><span style="color:#000066;">preg_match_all</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"/define<span style="color:#000099; font-weight:bold;">\s</span>*<span style="color:#000099; font-weight:bold;">\(</span><span style="color:#000099; font-weight:bold;">\s</span>*'(.*?)'<span style="color:#000099; font-weight:bold;">\s</span>*,<span style="color:#000099; font-weight:bold;">\s</span>*'(.*?)'<span style="color:#000099; font-weight:bold;">\s</span>*<span style="color:#000099; font-weight:bold;">\)</span>;/"</span>, <span style="color:#0000FF;">$content</span>, <span style="color:#0000FF;">$matches</span>, PREG_SET_ORDER<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$i</span> = <span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span> &lt;count<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$matches</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#0000FF;">$i</span>++ <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$name</span> = <span style="color:#0000FF;">$matches</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>; <span style="color:#0000FF;">$value</span> = <span style="color:#0000FF;">$matches</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$config</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$name</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$value</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#0000FF;">$link</span> = <a href="http://www.php.net/mysql_connect"><span style="color:#000066;">mysql_connect</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$config</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'DB_HOST'</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#0000FF;">$config</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'DB_USER'</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#0000FF;">$config</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'DB_PASSWORD'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Can't connect!"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<a href="http://www.php.net/mysql_select_db"><span style="color:#000066;">mysql_select_db</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$config</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'DB_NAME'</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Can't select database!"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lobstertechnology.com/2006/01/24/wordpress-hack-reading-mysql-username-and-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Experimenting with Googlebot</title>
		<link>http://blog.lobstertechnology.com/2006/01/23/experimenting-with-googlebot/</link>
		<comments>http://blog.lobstertechnology.com/2006/01/23/experimenting-with-googlebot/#comments</comments>
		<pubDate>Mon, 23 Jan 2006 15:27:17 +0000</pubDate>
		<dc:creator>Michael Cutler</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Search Engines]]></category>
		<category><![CDATA[Spiders & Bots]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://blog.lobstertechnology.com/2006/01/23/experimenting-with-googlebot/</guid>
		<description><![CDATA[In my previous post 'Blogs are fundamentally flawed…' I noted an observation that more often than not search results would direct a user to an index-style page containing the post instead of directly to the 'permalink' location of the post. This leads to a poor user-experience from the visitor’s point of view, on busy blogs [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post '<a href="http://blog.lobstertechnology.com/2006/01/03/blogs-are-fundamentally-flawed-for-the-typical-grandma-user/">Blogs are fundamentally flawed…</a>' I noted an observation that more often than not search results would direct a user to an index-style page containing the post instead of directly to the 'permalink' location of the post. This leads to a poor user-experience from the visitor’s point of view, on busy blogs the post has almost certainly moved since the page was spider'd. Google in particular appeared to be the worst for it.</p>
<p>Discussions on the subject with <a href='http://webofshite.com/'>Gerry</a> determined that this is most likely down to Google's PageRank technology; where index-style pages have a higher value than the post pages themselves. To get around this he suggested manipulating 'robots.txt' directives within the index-style pages.</p>
<p>On Google's "Information for Webmasters" help page I found they look for special 'robots.txt' directives and meta tags in documents when spidering specific to Googlebot only. This meant I could single out Googlebot for these directives and not affect other search engines (which don’t exhibit the problem so much).</p>
<p>I basically want Google to 'FOLLOW' links on all pages, but not to 'INDEX' the index-style pages like categories &#038; archives by date. The desired effect being that Google can find all posts as before but simply ignore the index-style pages themselves. Implementing this is quite simple; I modified my theme's "header.php" file inserting the following code in the "head" section:</p>
<div class="igBar"><span id="lphp-5"><a href="#" onclick="javascript:showPlainTxt('php-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-5">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> !is_single<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; !is_page<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; !is_home<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&nbsp; &lt;meta name=<span style="color:#000099; font-weight:bold;">\"</span>GOOGLEBOT<span style="color:#000099; font-weight:bold;">\"</span> content=<span style="color:#000099; font-weight:bold;">\"</span>NOINDEX,FOLLOW<span style="color:#000099; font-weight:bold;">\"</span> /&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This reads almost literally, if this is not a single post view, not a page view or the home page, add the following "meta..." tag. Although the home page is an index-style page I am reluctant to add 'NOINDEX' because I don't want it disappearing from search results. <img src='http://blog.lobstertechnology.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now the long wait for the changes to reflect in Google's results.</p>
<p>Updated 24th January 2006 - <a href='http://webofshite.com/'>Gerry</a> pointed out this can be optimised using <a href="http://en.wikipedia.org/wiki/De_Morgan's_Law">De Morgan's Law</a> <img src='http://blog.lobstertechnology.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> ! <span style="color:#006600; font-weight:bold;">&#40;</span>is_single<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> || is_page<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> || is_home<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&nbsp; &lt;meta name=<span style="color:#000099; font-weight:bold;">\"</span>GOOGLEBOT<span style="color:#000099; font-weight:bold;">\"</span> content=<span style="color:#000099; font-weight:bold;">\"</span>NOINDEX,FOLLOW<span style="color:#000099; font-weight:bold;">\"</span> /&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lobstertechnology.com/2006/01/23/experimenting-with-googlebot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress Hack » Inserting rel nofollow on links in all categories&#8230;</title>
		<link>http://blog.lobstertechnology.com/2005/12/01/wordpress-hack-rel-nofollow-on-links/</link>
		<comments>http://blog.lobstertechnology.com/2005/12/01/wordpress-hack-rel-nofollow-on-links/#comments</comments>
		<pubDate>Thu, 01 Dec 2005 01:38:30 +0000</pubDate>
		<dc:creator>Michael Cutler</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.lobstertechnology.com/2005/12/01/wordpress-hack-rel-nofollow-on-links/</guid>
		<description><![CDATA[I wanted to add rel='external nofollow' onto every Link in every Category that didn't have an explicit 'rel' attribute defined. I looked though the Wordpress Codex but found no Plugin Hooks to do it so I broke out the source code.]]></description>
			<content:encoded><![CDATA[<p>I wanted to add <cite>rel='external nofollow'</cite> onto every Link in every Category that didn't have an explicit <cite>rel</cite> attribute defined. I looked though the <a href='http://codex.wordpress.org/'>Wordpress Codex</a> but found no Plugin Hooks to do it so I broke out the source code.</p>
<p>Somewhere down the chain the link markup "&lt;a ..." is generated in the function  <cite>get_links()</cite> found in <cite>/wp-include/links.php</cite> (approx line 142). I added two lines of code shown below and it works a treat.</p>
<p><strong>Before</strong></p>
<div class="igBar"><span id="lphp-7"><a href="#" onclick="javascript:showPlainTxt('php-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-7">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$rel</span> = <span style="color:#0000FF;">$row</span>-&gt;<span style="color:#006600;">link_rel</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rel</span> != <span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$rel</span> = <span style="color:#FF0000;">" rel='$rel'"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>After</strong></p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$rel</span> = <span style="color:#0000FF;">$row</span>-&gt;<span style="color:#006600;">link_rel</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rel</span> != <span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$rel</span> = <span style="color:#FF0000;">" rel='$rel'"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$rel</span> = <span style="color:#FF0000;">" rel='external nofollow'"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lobstertechnology.com/2005/12/01/wordpress-hack-rel-nofollow-on-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
