<?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>Geekality &#187; WordPress</title>
	<atom:link href="http://www.geekality.net/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekality.net</link>
	<description>With a hint of Social Ineptitude</description>
	<lastBuildDate>Sun, 05 Feb 2012 17:53:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SQL for listing all WordPress tags</title>
		<link>http://www.geekality.net/2011/06/13/sql-for-listing-all-wordpress-tags/</link>
		<comments>http://www.geekality.net/2011/06/13/sql-for-listing-all-wordpress-tags/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 20:47:17 +0000</pubDate>
		<dc:creator>Torleif</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.geekality.net/?p=1715</guid>
		<description><![CDATA[When writing a post I sometimes find it difficult to choose what I should tag it with. I try reuse tags I already have to prevent a total mess, and sometimes I just don&#8217;t really remember what tags I have &#8230; <a href="http://www.geekality.net/2011/06/13/sql-for-listing-all-wordpress-tags/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When writing a post I sometimes find it difficult to choose what I should tag it with. I try reuse tags I already have to prevent a total mess, and sometimes I just don&#8217;t really remember what tags I have used so far. When writing a post in WordPress you can get a list of the most used ones, but once in a while I write a post on subject I haven&#8217;t written a lot about. So, instead of going to the Post Tags page and look through all the pages of tags, I decided to just connect to my blog database and run a query.</p>
<p><span id="more-1715"></span></p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> name<span style="color: #66cc66;">,</span> slug<span style="color: #66cc66;">,</span> description<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">COUNT</span> <span style="color: #993333; font-weight: bold;">FROM</span> wp_terms<br />
<span style="color: #993333; font-weight: bold;">NATURAL</span> <span style="color: #993333; font-weight: bold;">JOIN</span> wp_term_taxonomy<br />
<span style="color: #993333; font-weight: bold;">WHERE</span> taxonomy<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post_tag&quot;</span><br />
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> name</div></div>
<p>Lists all your tags, sorted by name <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':)' class='wp-smiley smiley-1' /> </p>
<p class="wp-flattr-button"></p> <p><a href="http://www.geekality.net/?flattrss_redirect&amp;id=1715&amp;md5=9996d29443248765a13d414f1e0aa91c" title="Flattr" target="_blank"><img src="http://www.geekality.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekality.net/2011/06/13/sql-for-listing-all-wordpress-tags/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Some speedy WordPress fixes</title>
		<link>http://www.geekality.net/2011/06/03/some-speedy-wordpress-fixes/</link>
		<comments>http://www.geekality.net/2011/06/03/some-speedy-wordpress-fixes/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 20:41:51 +0000</pubDate>
		<dc:creator>Torleif</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Compression]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Speed]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.geekality.net/?p=1706</guid>
		<description><![CDATA[Used Page Speed for FireFox the other day to analyze my blog. Found a couple of issues and a couple were very simple to fix. If these will work for you, depends a bit on where your WordPress site is &#8230; <a href="http://www.geekality.net/2011/06/03/some-speedy-wordpress-fixes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Used <a href="http://code.google.com/speed/page-speed/docs/using_firefox.html">Page Speed</a> for FireFox the other day to analyze my blog. Found a couple of issues and a couple were very simple to fix. If these will work for you, depends a bit on where your WordPress site is hosted and what your web server does already. So, be brave and analyze your own site. Look through the results and see if you can fix some of it without too much hassle <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':)' class='wp-smiley smiley-1' /> </p>
<p><span id="more-1706"></span></p>
<h2>Missing expiration date and unnecessary ETag</h2>
<p>The browser caches stuff, and to do that it needs some information. When we have stuff that doesn&#8217;t change very often (if ever) we should tell the browser that, once you&#8217;ve downloaded this, you don&#8217;t really need to check back for a new version for a while. To do this we add an expiration date. In addition you have two headers called Last-Modified and one called ETag. you can read more about that and all the rest of this in the link earlier in this paragraph, but the short story is you should have one. Having both is just not necessary. When I checked the headers sent with my images, I found that both were sent. So I decided to turn off the FileETag. To do all of this, for images, javascript files and stylesheets, I added the following lines to the <a href="http://en.wikipedia.org/wiki/.htaccess">.htaccess</a> file in the root of my WordPress blog:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;FilesMatch &quot;\.(ico|jpg|jpeg|png|gif|js|css)$&quot;&gt;<br />
&nbsp; ExpiresActive On<br />
&nbsp; ExpiresDefault &quot;access plus 2 weeks&quot;<br />
&nbsp; FileETag none<br />
&lt;/FilesMatch&gt;</div></div>
<p><a href="http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching">More info</a></p>
<h2>Enable Compression</h2>
<p>Compressing stuff means less data has to go across the wire between the browser and the web server. Which is generally a nice thing. And as long as the web server supports it, enabling it is pretty simple. Just add the following line to your <a href="http://en.wikipedia.org/wiki/.htaccess">.htaccess</a> file.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/javascript</div></div>
<p><a href="http://code.google.com/speed/page-speed/docs/payload.html#GzipCompression">More info</a></p>
<h2>Don&#8217;t touch the default stuff</h2>
<p>Just to make it less likely that someone messes up their WordPress installation after reading this: Make sure you <em>add</em> the above stuff. Do not just replace the .htaccess file. WordPress comes with an .htaccess file, and what&#8217;s in there needs to be there. Here is how the default stuff looks in mine:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># BEGIN WordPress<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteRule ^index\.php$ - [L]<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;<br />
# END WordPress</div></div>
<p>Unless you know what you&#8217;re doing, it&#8217;s probably a good idea to not touch any of that <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':)' class='wp-smiley smiley-1' /> And if you <em>do</em> end up messing up your WordPress blog after reading this blog post, don&#8217;t blame me <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':P' class='wp-smiley smiley-13' /> </p>
<p class="wp-flattr-button"></p> <p><a href="http://www.geekality.net/?flattrss_redirect&amp;id=1706&amp;md5=dcfafa9e08f9cdf7a8ae87f6af5467f1" title="Flattr" target="_blank"><img src="http://www.geekality.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekality.net/2011/06/03/some-speedy-wordpress-fixes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This blog post can make WordPress crash</title>
		<link>http://www.geekality.net/2010/10/18/this-blog-post-can-make-wordpress-crash/</link>
		<comments>http://www.geekality.net/2010/10/18/this-blog-post-can-make-wordpress-crash/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 21:17:09 +0000</pubDate>
		<dc:creator>Torleif</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mod_Security]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.geekality.net/?p=1228</guid>
		<description><![CDATA[Was writing a blog post today. Happy, typing away. Hit Preview, and *bam*: Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Say wahaat? Strange thing &#8230; <a href="http://www.geekality.net/2010/10/18/this-blog-post-can-make-wordpress-crash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Was writing a blog post today. Happy, typing away. Hit Preview, and *bam*:</p>
<blockquote><p>Service Temporarily Unavailable</p>
<p>The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</p></blockquote>
<p><span id="more-1228"></span></p>
<p><img src="http://www.geekality.net/wp-content/uploads/2010/10/Shattered-300x231.jpg" alt="Shattered glass" title="Shattered" width="300" height="231" class="alignright size-medium wp-image-1365" />Say wahaat? Strange thing was my website was otherwise working normally. Could even edit other posts just fine!</p>
<p>Some head scratching, googling and making a support request to Dreamhost followed. Apparently they had just had an outtake, so I figured it might be related. They did too. But it was not! I finally found the answer on a blog:</p>
<blockquote><p>Turns out this error is not alone in WordPress and not a bug of it at all. Some of the administration tasks of other CMS software such as posting posts with PHP code in them and uploading stuff would also trigger a module in Apache called Mod_security to be over sensitive. &#8212; <a href="http://www.kavoir.com/2009/04/wordpress-503-service-temporarily-unavailable-when-posting-new-posts-or-modifying-existing-posts.html">www.kavoir.com</a></p></blockquote>
<p>And sure enough, I had mentioned a PHP function called <a href="http://www.php.net/manual/en/function.curl-exec.php">curl_exec</a> in my blog post. Once I removed that word, the post could be previewed and saved just fine. Great stuff&#8230;</p>
<h2>Solution</h2>
<p>Of course I could just have avoided using that word, but that&#8217;s no fun. After reading the rest of that mentioned blog post, some comments and <a href="http://wiki.dreamhost.com/Mod_security">wiki page at Dreamhost</a>, I found that by adding the lines below to the .htaccess file the problem was fixed. Or makes it go away at least <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':P' class='wp-smiley smiley-13' /> </p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;IfModule mod_security.c&gt;<br />
&nbsp; SetEnvIfNoCase Request_URI ^/wp-admin/(?:post|async-upload)\.php$ MODSEC_ENABLE=Off<br />
&nbsp; SetEnvIfNoCase Request_URI ^/xmlrpc\.php$ MODSEC_ENABLE=Off<br />
&nbsp; SecFilterDebugLevel 0<br />
&nbsp; SecFilterDefaultAction &quot;deny,nolog,noauditlog,status:503&quot;<br />
&lt;/IfModule&gt;</div></div>
<p>Alrighty&#8230; back to my actual blog post&#8230;</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekality.net/2010/10/18/this-blog-post-can-make-wordpress-crash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to delete WordPress post revisions</title>
		<link>http://www.geekality.net/2009/10/20/how-to-delete-wordpress-post-revisions/</link>
		<comments>http://www.geekality.net/2009/10/20/how-to-delete-wordpress-post-revisions/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 21:40:23 +0000</pubDate>
		<dc:creator>Torleif</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.geekality.net/?p=689</guid>
		<description><![CDATA[Having revisions on my posts is nice I suppose. But I was starting to get a bit annoyed with the increasingly long list of revisions in each post. And they really did get long. Mainly because I am in a &#8230; <a href="http://www.geekality.net/2009/10/20/how-to-delete-wordpress-post-revisions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Having revisions on my posts is nice I suppose. But I was starting to get a bit annoyed with the increasingly long list of revisions in each post. And they really did get long. Mainly because I am in a bit of a testing and experimenting phase which means that I have done a lot of adjustments to almost every single post so far because I don&#8217;t have 100% control on how I want things or how things will end up looking and so on <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':P' class='wp-smiley smiley-13' /> There&#8217;s also of course all the obligatory spelling errors I only discover <em>after</em> I have clicked Publish <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':P' class='wp-smiley smiley-13' /> </p>
<p>Anyways, I found a nice little MySQL snippet to clear out all of them in a French comment to <a href="http://www.mydigitallife.info/2008/07/22/how-to-delete-existing-wordpress-post-revisions-storedsaved/">a blog post</a>. Thought I could share it here. That way I won&#8217;t lose it either <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':)' class='wp-smiley smiley-1' /> </p>
<p><span id="more-689"></span></p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">DELETE</span> x<span style="color: #66cc66;">,</span>y<span style="color: #66cc66;">,</span>z<br />
<span style="color: #993333; font-weight: bold;">FROM</span> wp_posts x<br />
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> wp_term_relationships y <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#40;</span>x<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> y<span style="color: #66cc66;">.</span>object_id<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> wp_postmeta z <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#40;</span>x<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> z<span style="color: #66cc66;">.</span>post_id<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">WHERE</span> x<span style="color: #66cc66;">.</span>post_type <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'revision'</span></div></div>
<p>You can swap <code class="codecolorer text default"><span class="text">delete x,y,z</span></code> with <code class="codecolorer text default"><span class="text">select *</span></code> to check that it will delete what you really want to.</p>
<p>Remember that if you have a table prefix other than &#8216;wp_&#8217; set in your wp-config.php, you need to change that in your SQL script before you run it. The line looks like this in my config file:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$table_prefix</span> &nbsp;<span style="color: #339933;">=</span> <span style="color: #0000ff;">'wp_'</span><span style="color: #339933;">;</span></div></div>
<p>I can also recommend setting WP_POST_REVISIONS to something in your wp-config.php file. Just search for REVISIONS in that file. If you don&#8217;t find it, you can just add it somewhere. The line should look like the following, where N would be how many revisions you want to allow, or -1 if you want them all:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_POST_REVISIONS'</span><span style="color: #339933;">,</span> N<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>I will still run the SQL script once in a while though, cause after a while my posts become sort of stable, and having revisions with my spelling errors hanging around for ever doesn&#8217;t really make sense in my head <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':P' class='wp-smiley smiley-13' /> </p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekality.net/2009/10/20/how-to-delete-wordpress-post-revisions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

