<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Digging into WordPress</title>
	
	<link>http://digwp.com</link>
	<description>Learn how to take your WordPress skills to the next level.</description>
	<lastBuildDate>Wed, 01 Sep 2010 14:47:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DiggingIntoWordpress" /><feedburner:info uri="diggingintowordpress" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>DiggingIntoWordpress</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>URL Sentences in WordPress</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/e0rB0mj2ACA/how-to-set-up-urls-as-sentences-in-wordpress</link>
		<comments>http://digwp.com/2010/09/url-sentences-in-wordpress/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 14:47:06 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2837</guid>
		<description><![CDATA[WPCandy is back under Ryan Imel and it&#8217;s been loaded with good stuff lately, including this great run-through of how to use Chris Shiflett&#8217;s URL sentences idea in WordPress. digwp.com/thinks/this-is-a-cool-idea Direct Link to Article &#8212; Permalink on DiWLike the article? Get the book! © 2010 Digging into WordPress &#124; Permalink &#124; Comments &#124; Add to [...]]]></description>
			<content:encoded><![CDATA[<p>WPCandy is back under Ryan Imel and it&#8217;s been loaded with good stuff lately, including this great run-through of how to use Chris Shiflett&#8217;s URL sentences idea in WordPress.</p>
<p>digwp.com/thinks/this-is-a-cool-idea</p>
<p><small><a href="http://wpcandy.com/teaches/how-to-set-up-urls-as-sentences-in-wordpress" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/09/url-sentences-in-wordpress/" 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/09/url-sentences-in-wordpress/">Permalink</a> | <a href="http://digwp.com/2010/09/url-sentences-in-wordpress/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/09/url-sentences-in-wordpress/&title=URL Sentences in&nbsp;WordPress">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><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/e0rB0mj2ACA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/09/url-sentences-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://wpcandy.com/teaches/how-to-set-up-urls-as-sentences-in-wordpress</feedburner:origLink></item>
		<item>
		<title>Version 3.0 Launch!</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/RFH2JRQ1cZY/</link>
		<comments>http://digwp.com/2010/09/version-3/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 07:46:12 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[3.0]]></category>
		<category><![CDATA[book]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2768</guid>
		<description><![CDATA[It&#8217;s here! Digging into WordPress Version 3.0 is here and it&#8217;s packed with goodness, including a new chapter on WordPress 3, updated core content, and a super-sleek new cover. Check it out: DiW3 cover by Chris Coyier Updated Core Material Much has changed with WordPress since our previous book update (v2), so for version 3.0 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>It&rsquo;s here!</strong> <a href="http://digwp.com/book/" title="Version 3.0!">Digging into WordPress Version 3.0</a> is here and it&rsquo;s <em>packed</em> with goodness, including a new chapter on WordPress 3, updated core content, and a <em>super-sleek</em> new cover. Check it out:</p>
<p><img src="http://digwp.com/wp-content/blog-images/v3-launch-cover.jpg" alt="[ Digging into WordPress V3 ]" /><br /><small>DiW3 cover by Chris Coyier</small></p>
<h3>Updated Core Material</h3>
<p>Much has changed with WordPress since our <a href="http://digwp.com/2010/03/digwpv2/" title="Digging Into WordPress v2.0 + Print is Back! (Oh, and a fresh new design!)">previous book update</a> (v2), so for version 3.0 we went through the book and updated/removed outdated core content. Everything is now hot-wired and fine-tuned to the latest version of WordPress, with new popouts and fresh links throughout the book. Here&rsquo;s a close-up of one the updated pages (a flow-chart for templates):</p>
<p><img src="http://digwp.com/wp-content/blog-images/v3-launch-templates.jpg" alt="[ Digging into WordPress Screenshot ]" /></p>
<h3>New Chapter on WordPress 3.0</h3>
<p>WordPress 3.0 is better than ever. Released on June 17th 2010, <abbr title="WordPress">WP</abbr>3.0 features <em>tons</em> of new functionality and <abbr title="Content Management System">CMS</abbr> capabilities. So much good stuff, that we added an entire chapter covering all the <strong>best new <abbr title="WordPress">WP</abbr>3.0 features</strong>:</p>
<ul>
<li>New default theme</li>
<li>Custom Admin usernames</li>
<li>How to customize your background</li>
<li>How to setup and use <abbr title="WordPress">WP</abbr> MultiSite</li>
<li>Custom taxonomies, menus, and post types</li>
</ul>
<p>Plus a whole bunch of other stuff, including how to use the built-in shortlink feature, author templates, comment-form template-tags, and more. It&rsquo;s <strong>20+ pages</strong> of <em>new</em> <abbr title="WordPress">WP</abbr>3.0 content.</p>
<p><img src="http://digwp.com/wp-content/blog-images/v3-launch-page.jpg" alt="[ Digging into WordPress Screenshot ]" style="margin-top:20px;" /><br /><small>Detail-view of new WP3 content</small></p>
<p><span id="more-2768"></span></p>
<h3>Included with Purchase</h3>
<p>Here&rsquo;s what you get for $27:</p>
<ul>
<li>Beautiful, full-color, easy-to-read design</li>
<li>Nearly 450 pages of practical, how-to WordPress content</li>
<li>3 Free Themes: <a href="http://themeclubhouse.digwp.com/index.php?wptheme=All%20AJAX" title="Live Demo" rel="external">All Ajax</a>, <a href="http://themeclubhouse.digwp.com/index.php?wptheme=Lines%20and%20Boxes" title="Live Demo" rel="external">Lines &amp; Boxes</a>, and <a href="http://themeclubhouse.digwp.com/index.php?wptheme=Plastique" title="Live Demo" rel="external">Plastique</a></li>
<li><strong>Free Lifetime Updates</strong> (current book owners received version 3.0 <em>yesterday</em>)</li>
<li>Friendly, helpful customer support :)</li>
</ul>
<p>Like WordPress itself, Digging into WordPress gets better with each new version. And the nice thing about <abbr title="Portable Document Format">PDF</abbr> format is that you can read the book anywhere, <a href="http://digwp.com/2010/04/ereaders/" title="eReaders and Digging Into WordPress">even on the iPad</a>. Plus you get useful stuff like actual, clickable hyperlinks and linked Table of Contents. Also the <abbr title="Portable Document Format">PDF</abbr> format makes it easy to copy/paste code and other content, so you have everything all in one place. You can <a href="http://digwp.com/book/" title="Digging into WordPress">learn more and get the book here</a>.</p>
<h3>Printed Copies</h3>
<p>We were sort of on the fence about printing more physical copies of the book, but after some <a href="http://digwp.com/2010/06/what-no-printed-copies/#comments" title="What? No Printed Copies?">great feedback</a>, everything fell into place. Our current goal is to make printed copies of v3.0 available in September/October. The printed books seem to disappear quickly, so if you want a copy <a href="http://feeds2.feedburner.com/DiggingIntoWordpress" title="WordPress Goodness">stay tuned</a> for the announcement post.</p>
<h3>Updated Sample PDF</h3>
<p>Here is an updated <a href="http://digwp.com/book-demo/Digging-Into-WP-DEMO.pdf" title="Download Free Sample Chapter">Sample Chapter</a> showing the new Table of Contents and part of Chapter 3. For more information on Digging into WordPress, check out the <a href="http://digwp.com/book/" title="Learn more about DiW">Official DiW Bookstore</a> at <a href="http://digwp.com/" title="Digging into WordPress">DigWP.com</a>, the free companion site for the book, featuring tons of awesome WordPress tips, tricks, and tutorials. So here&rsquo;s to <abbr title="Digging into WordPress">DiW</abbr> version 3.0 and no sign of slowing down ;)</p>
<p><a href="http://digwp.com/contact/" title="Contact Chris and Jeff">Questions about the book?</a></p>
<p>Shortlink for this post:<br />
<input value="http://digwp.com/?p=2768" size="25" />
<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/09/version-3/">Permalink</a> | <a href="http://digwp.com/2010/09/version-3/#comments">13 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/09/version-3/&title=Version 3.0&nbsp;Launch!">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/3-0/" rel="tag">3.0</a>, <a href="http://digwp.com/tag/book/" rel="tag">book</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/RFH2JRQ1cZY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/09/version-3/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/09/version-3/</feedburner:origLink></item>
		<item>
		<title>Pimp your wp-config.php</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/Khq-CbqQC9A/</link>
		<comments>http://digwp.com/2010/08/pimp-your-wp-config-php/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 18:52:39 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2416</guid>
		<description><![CDATA[Easily, the most important file in your WordPress installation is the wp-config.php file. It serves as your site&#8217;s base configuration file, controlling key aspects of WordPress&#8217; functionality and enabling WordPress to do mission-critical stuff like connect to the database. Without wp-config.php, WordPress simply won&#8217;t work. So whenever you install WordPress, one of the first things [...]]]></description>
			<content:encoded><![CDATA[<p>Easily, the most <em>important</em> file in your WordPress installation is the <code>wp-config.php</code> file. It serves as your site&rsquo;s <strong>base configuration file</strong>, controlling <em>key aspects</em> of WordPress&rsquo; functionality and enabling WordPress to do mission-critical stuff like connect to the database. Without <code>wp-config.php</code>, WordPress simply won&rsquo;t work. So whenever you install WordPress, one of the <em>first</em> things to do is pimp your <code>wp-config.php</code>.</p>
<p>And it&rsquo;s pretty easy too &ndash; just get your database credentials in place and you&rsquo;re done. The other settings available in the <code>wp-config.php</code> file will work just fine using the default values, but there are some <em>cool things</em> you can do to customize functionality, tighten security, and improve performance. Once you get the basics of <code>wp-config.php</code>, you can really <em>pimp it out</em> to do some awesome stuff. We&rsquo;ll break this down into <strong>four basic parts</strong>:</p>
<ul>
<li><a href="http://digwp.com/2010/08/pimp-your-wp-config-php/#basics" title="There is no wp-config.php..">Basics</a></li>
<li><a href="http://digwp.com/2010/08/pimp-your-wp-config-php/#security" title="Protect wp-config.php">Security</a></li>
<li><a href="http://digwp.com/2010/08/pimp-your-wp-config-php/#settings" title="Main Configuration Settings">Main Settings</a></li>
<li><a href="http://digwp.com/2010/08/pimp-your-wp-config-php/#pimpin" title="Pimp it out!">Additional Tips and Tricks</a></li>
</ul>
<p><span id="more-2416"></span></p>
<h3 id="basics">There is no wp-config.php..</h3>
<p>When you first download WordPress, the <code>wp-config.php</code> file isn&rsquo;t included. Instead, you get a file named &ldquo;<code>wp-config-sample.php</code>&rdquo; (located in the root install-directory) that contains everything you need. Just rename the file to &ldquo;<code>wp-config.php</code>&rdquo; and delete the <code>wp-config-sample.php</code> file from the server if it&rsquo;s already there. Here is a visual:</p>
<p><img src="http://digwp.com/wp-content/blog-images/wp-config-01.jpg" alt="[ Rename the file ]" /></p>
<p>With the <code>wp-config.php</code> file now ready to go, it&rsquo;s time to protect it..</p>
<h3 id="security">Protect wp-config.php</h3>
<p>The first thing you want to do with <code>wp-config.php</code> is protect it. Here is a great way to secure the file using .htaccess:</p>
<pre><code>&lt;Files wp-config.php&gt;
	Order Allow,Deny
	Deny from all
&lt;/Files&gt;</code></pre>
<p>This code should be placed in an .htaccess file located in the directory that contains your <code>wp-config.php</code> file.</p>
<p><img src="http://digwp.com/wp-content/blog-images/wp-config-02.jpg" alt="[ Use the same directory ]" /></p>
<p>Once the .htaccess file is in place, ensure that permissions are <abbr title="change mode">chmod</abbr> <strong>640</strong> for both files. This setting returns a &ldquo;403 Forbidden&rdquo; error to all external requests. Combining proper file permissions with .htaccess protection is an excellent way to <em>secure</em> your <code>wp-config.php</code>.</p>
<h3 id="settings">Main Configuration Settings</h3>
<p>Now that <code>wp-config.php</code> is secure, it&rsquo;s time to add the required database information and then customize for optimum performance. This section covers the first four configuration settings that you&rsquo;ll find <em>already included</em> in your <code>wp-config.php</code>. Then in the next section, we&rsquo;ll explore some awesome techniques and really pimp things out.</p>
<h4>1) Database credentials</h4>
<p>The first and only <em>required</em> step is to add your database credentials. This should appear after the PHP comments near the top of the file:</p>
<pre><code>// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');</code></pre>
<p>For most servers, you&rsquo;ll need only the first three bits of information: database name, username and password. If WordPress can&rsquo;t connect after that, then you may need to change the hostname to whatever your host tells you. Only fiddle with the last two items &ndash; charset and collate &ndash; if you have need and know what you&rsquo;re doing.</p>
<h4>2) Authentication Unique Keys and Salts</h4>
<p>Next up is a section for key/salt definitions. By default it looks like this:</p>
<pre><code>/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

/**#@-*/</code></pre>
<p>The eight definitions should be replaced with values generated via the official <a href="https://api.wordpress.org/secret-key/1.1/salt/">WordPress.org secret-key service</a>. Visit that link, refresh the page a few times, and paste the results into place, like so:</p>
<pre><code>/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         ')` 4yDGc w=*:l8@RD167k0+/+@+rgo(mI-x&lt;_~.=WtCm[qD8&lt;3S)TsR}K~bMLNT');
define('SECURE_AUTH_KEY',  'zO?htRkV.k[vBqn&lt;+.,lorpObkc?@|Vi+8`w=A9,|FjPB&amp;5`5|9&lt;[&amp;&amp;WaUB.pwTS');
define('LOGGED_IN_KEY',    'jtr|J-/.-:6CVh*8h.~bNzc3^#A9@hB9G3E/fx/&gt;k)pmTHbES5^Rq(+EINCW w&gt;8');
define('NONCE_KEY',        'O2Vz+br+`6MqQVv1{-g}sy -CF8M/tldEyWV[W}dnebd7m$6.P,m+.G6Ec]{V@Kl');
define('AUTH_SALT',        '&gt;x,, 8wMLIJCH}i94Ib+}~lR%r_))x@LU3~YJwCok++xaSVE@[My(zAg!Fpi4{NR');
define('SECURE_AUTH_SALT', '7[,gAJ#TQmsw:$!R-n-r%4&lt;UvG7%|-7&amp;jt4]XS-[KX&amp;O)|H,err]&lt;{EuFnmP3,M}');
define('LOGGED_IN_SALT',   '9dJP8uW2E2&amp;.^a|@I|[?qbY%z:&amp;jgnH&lt;OUg+t6Tks,Hox=M@~yx+b;~zU)436q=+');
define('NONCE_SALT',       '=Xv~8+!&gt;l:wy`~w0U-6wO2lmG8l5Xg21$J59T$T~)(h5m&lt;5`|/|dVN{j[80QMV60');

/**#@-*/</code></pre>
<p>Don&rsquo;t use the example keys shown here though &ndash; the whole idea is to specify <em>unique</em> phrases to <em>improve</em> security. And it&rsquo;s totally fine to replace these keys at any time &ndash; the worst that will happen is that currently logged-in users will need to log in again. </p>
<p>At this point, we have our database credentials and secret keys all ready to go. Next we want to <em>further improve security</em> by specifying a unique database prefix.</p>
<h4>3) WordPress Database Table prefix</h4>
<p>WordPress is a <em>huge</em> target for <a href="http://digwp.com/2010/07/wordpress-security-lockdown/#pharma-hack" title="WordPress Security Lockdown">malicious scripts</a>, <a href="http://digwp.com/2010/07/media-temple-wordpress-hack/" title="Media Temple WordPress Hack">hacks</a>, and <a href="http://digwp.com/2009/06/spam-link-injection-hacked/" title="Spam Link Injection Hacked (and How I Hopefully Fixed It)">spam</a>. One of the best ways to secure your WordPress database is to change the default table prefix. The default value, as seen below, is &ldquo;<code>wp_</code>&rdquo;:</p>
<pre><code>/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';
</code></pre>
<p>This works, but as the default value, it is heavily targeted by <a href="http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/" title="Protect WordPress Against Malicious URL Requests">malicious scripts</a> and <a href="http://perishablepress.com/press/2010/07/14/blackhole-bad-bots/" title="Protect Your Site with a Blackhole for Bad Bots">bad bots</a>. Changing it to something <em>unique</em> essentially <em>immunizes</em> it against automated attacks on anything prefixed with <code>wp_</code>. The more <em>random and unique</em> the better, like a password: &ldquo;<code>h7G3vcDEo3jDf_</code>&rdquo; would be a good example. Note that ending the string with an underscore or some other easily recognizable character is a good way to keep things readable and easy to use.</p>
<h4>4) WordPress Localized Language</h4>
<p>By default WordPress uses the English language, but you can use any available language by following <a href="http://codex.wordpress.org/Installing_WordPress_in_Your_Language" title="Installing WordPress in Your Language">these steps</a>. As a part of that process, you&rsquo;ll specify your language in this part of the <code>wp-config.php</code> file:</p>
<pre><code>/**
 * WordPress Localized Language, defaults to English.
 *
 * Change this to localize WordPress.  A corresponding MO file for the chosen
 * language must be installed to wp-content/languages. For example, install
 * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
 * language support.
 */
define ('WPLANG', '');</code></pre>
<p>It&rsquo;s pretty straightforward: if nothing is specified (as is seen here), English is used; otherwise, you include the <code>.mo</code> language file you are using for the translation.</p>
<h3 id="pimpin">Additional Tips and Tricks</h3>
<p>Now that you&rsquo;ve got the database connection, security keys, table prefix, and language definition dialed in you&rsquo;re ready to rock. Most WordPress sites are in great shape at this point, but there is <em>much</em> more that we can do with <code>wp-config.php</code> to maximize performance and make our lives easier.</p>
<h4>Pimping Post Revisions</h4>
<p>Recent versions of WordPress provides a post-revisioning system that enables users to save different versions of their blog posts and even revert to previously saved versions if necessary. Regardless of how much you do or do not despise this amazingly awesome feature, here are a couple of configurational definitions that may prove useful for you:</p>
<pre><code>// Limit the number of saved revisions
define('WP_POST_REVISIONS', 3); // any integer, but don't go crazy

// Disable the post-revisioning feature
define('WP_POST_REVISIONS', false); // kill the bloat</code></pre>
<h4>Specify the Autosave Interval</h4>
<p>In a similar vein as the post-revisioning feature is WordPress’ actually useful Autosave functionality. By default, WordPress saves your work every 60 seconds, but you can totally modify this setting to whatever you want. Don’t get too crazy though, unless you want to stress-out your server&nbsp;;)</p>
<pre><code>define('AUTOSAVE_INTERVAL', 160); // in seconds, don't go nuts</code></pre>
<h4>Automated Trash</h4>
<p>Since WordPress 2.9, we&rsquo;ve had the &ldquo;Trash&rdquo; feature to help prevent accidents. So now instead of deleting stuff like posts and comments, you send them to the Trash. By default WordPress deletes the Trash every 30 days, but you can set it to whatever you want by adding a line like this to <code>wp-config.php</code>:</p>
<pre><code>define('EMPTY_TRASH_DAYS', 7); // empty weekly</code></pre>
<p>To ride bareback without the safety net, you can disable the Trash feature by specifying a zero value:</p>
<pre><code>define('EMPTY_TRASH_DAYS', 0); // disable trash</code></pre>
<p>By disabling Trash, you&rsquo;ll be deleting stuff permanently the first time, just like way back in the day.</p>
<h4>Automatic Database Repair</h4>
<p>WordPress 2.9 also gave us automatic database repair, which enables you to repair and optimize your database even when not logged in. This functionality should be used on an <em>as-needed</em> basis by first adding the following snippet to <code>wp-config.php</code>:</p>
<pre><code>define('WP_ALLOW_REPAIR', true);</code></pre>
<p>With that in place, visit the following <abbr title="Uniform Resource Locator">URL</abbr> to open the &ldquo;Database Repair&rdquo; page:</p>
<p><code>http://example.com/wp-admin/maint/repair.php</code></p>
<p>There you&rsquo;ll be able to optimize and repair your database without needing to log in to WordPress. Important: While you have  <code>WP_ALLOW_REPAIR</code> set in <code>wp-config.php</code>, the Database Repair page is openly accessible by anyone who finds it. So definitely remove the line to disable the auto-repair functionality after you are done using it.</p>
<h4>Block External Requests</h4>
<p>If you need to prevent WordPress from making external requests, add this snippet to <code>wp-config.php</code>:</p>
<pre><code>define('WP_HTTP_BLOCK_EXTERNAL', true);</code></pre>
<p>This will prevent things from happening that normally happen, like updates, dashboard feeds, and data reporting. Fortunately, it&rsquo;s easy to whitelist (<em>allow</em> access) anything that is needed. Here is an example where we grant access to pingomatic.com:</p>
<pre><code>define('WP_ACCESSIBLE_HOSTS', 'rpc.pingomatic.com');</code></pre>
<h4>Blog Address and Site Address</h4>
<p>By default, these two configurational definitions are not included in the <code>wp-config.php</code> file, but they may be added to improve performance. These two settings were introduced in WordPress version 2.2 and override the database value without actually changing them. Example:</p>
<pre><code>define('WP_HOME', 'http://digwp.com'); // no trailing slash
define('WP_SITEURL', 'http://digwp.com');  // no trailing slash</code></pre>
<p>These settings should match those specified in your WordPress Admin. Once you set them in <code>wp-config.php</code>, they will be &ldquo;grayed-out&rdquo; when displayed in the Admin.</p>
<h4>Debugging WordPress</h4>
<p>Since WordPress version 2.3.1, users have been able to display certain errors and warnings to help with the debugging of their site. As of WordPress version 2.5, enabling error reporting raises the reporting level to <code>E_ALL</code> and activates warnings for deprecated functions. By default (i.e., if no definition is specified in the <code>wp-config.php</code> file), error reporting is disabled.</p>
<pre><code>define('WP_DEBUG', true); // debugging mode: 'true' = enable; 'false' = disable</code></pre>
<p>Adding that snippet to <code>wp-config.php</code> tells WordPress to display warnings and error messages with your web pages. This functionality is <em>extremely useful</em> but infrequently used by plugin and theme developers. If you&rsquo;ve never enabled debugging, you&rsquo;re in for a surprise &ndash; lots of errors even with some of the most popular plugins.</p>
<h4>Error Log Configuration</h4>
<p>Here is an easy way to enable basic error logging for your WordPress-powered site. Create a file called <code>php_error.log</code>, make it server-writable, and place it in the directory of your choice. Then edit the path in the third line of the following code and place into your <code>wp-config.php</code>:</p>
<pre><code>@ini_set('log_errors','On');
@ini_set('display_errors','Off');
@ini_set('error_log','/home/path/domain/logs/php_error.log');</code></pre>
<p>Error logs are powerful tools for keeping an eye on things and expediently resolving issues. It&rsquo;s awesome that WordPress makes this so easy. We cover this in greater depth along with a couple of other methods in <a href="http://digwp.com/2009/07/monitor-php-errors-wordpress/" title="3 Ways to Monitor PHP Errors">this post</a>.</p>
<h4>Increase PHP Memory</h4>
<p>If you are receiving error messages telling you that your &ldquo;Allowed memory size of xxx bytes exhausted,&rdquo; this setting may help resolve the issue. As of WordPress version 2.5, the <code>WP_MEMORY_LIMIT</code> definition enables you to specify the maximum amount of memory that may be used by PHP. Here are some examples:</p>
<pre><code>define('WP_MEMORY_LIMIT', '64M');
define('WP_MEMORY_LIMIT', '96M');
define('WP_MEMORY_LIMIT', '128M');</code></pre>
<p>By default, WordPress will automatically attempt to increase PHP memory up to 32MB, so this setting is only needed for values higher than 32MB. Note that some web hosts disable your ability to increase PHP memory, so you may need to ask (or beg) for them to do it.</p>
<h3>More info, tips and tricks for wp-config</h3>
<p>For more information on the <code>wp-config.php</code> file, <a href="http://codex.wordpress.org/Editing_wp-config.php" title="Editing wp-config.php">check out the WordPress Codex</a>. We also have some <a href="http://digwp.com/2009/06/wordpress-configuration-tricks/" title="WordPress Configuration Tricks">awesome wp-config tricks</a> and <a href="http://digwp.com/2009/07/optimize-wordpress-performance-with-the-wp-config-php-file/" title="Optimize WordPress Performance with the wp-config.php File">wp-config optimization tips</a> for your WordPress enjoyment :)</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/08/pimp-your-wp-config-php/">Permalink</a> | <a href="http://digwp.com/2010/08/pimp-your-wp-config-php/#comments">36 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/08/pimp-your-wp-config-php/&title=Pimp your&nbsp;wp-config.php">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/php/" title="View all posts in PHP" rel="category tag">PHP</a> | Tagged: <a href="http://digwp.com/tag/database/" rel="tag">database</a>, <a href="http://digwp.com/tag/performance/" rel="tag">performance</a>, <a href="http://digwp.com/tag/security/" rel="tag">Security</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/Khq-CbqQC9A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/pimp-your-wp-config-php/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/08/pimp-your-wp-config-php/</feedburner:origLink></item>
		<item>
		<title>Delay Loading of Print CSS</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/1EHY3KG-e2k/</link>
		<comments>http://digwp.com/2010/08/delay-loading-of-print-css/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 22:53:47 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2686</guid>
		<description><![CDATA[Peter Wilson walks us through making sure print stylesheets are loaded after the rest of the page is loaded, so they don&#8217;t hold up page rendering. Direct Link to Article &#8212; Permalink on DiWLike the article? Get the book! © 2010 Digging into WordPress &#124; Permalink &#124; Comments &#124; Add to Delicious Categorized: Links &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Peter Wilson walks us through making sure print stylesheets are loaded after the rest of the page is loaded, so they don&#8217;t hold up page rendering.</p>
<p><small><a href="http://bigredtin.com/behind-the-websites/delay-loading-of-print-css/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/08/delay-loading-of-print-css/" 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/08/delay-loading-of-print-css/">Permalink</a> | <a href="http://digwp.com/2010/08/delay-loading-of-print-css/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/08/delay-loading-of-print-css/&title=Delay Loading of Print&nbsp;CSS">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><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/1EHY3KG-e2k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/delay-loading-of-print-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bigredtin.com/behind-the-websites/delay-loading-of-print-css/</feedburner:origLink></item>
		<item>
		<title>Digg Technical Talks – Rasmus Lerdorf</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/WI2_xPn8g6s/13768954</link>
		<comments>http://digwp.com/2010/08/digg-technical-talks-rasmus-lerdorf/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 02:20:40 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2684</guid>
		<description><![CDATA[Pardon my ignorance here, but Rasmus starts talking about latency and concurrent requests about 16:30. He then mentions &#8220;one line of code&#8221; installation of something that sounds like &#8220;aqua code cache&#8221; that gives WordPress a 3x performance boost in response time / number of transactions per second. Anyone knows what he&#8217;s talking about there, shoot [...]]]></description>
			<content:encoded><![CDATA[<p>Pardon my ignorance here, but Rasmus starts talking about latency and concurrent requests about 16:30. He then mentions &#8220;one line of code&#8221; installation of something that sounds like &#8220;aqua code cache&#8221; that gives WordPress a 3x performance boost in response time / number of transactions per second. Anyone knows what he&#8217;s talking about there, <a href="http://digwp.com/contact/">shoot a note</a> and I&#8217;ll update this permalink with the info. He goes on to talk about much more hardcore-PHP-nerd WordPress optimization stuff.</p>
<p><strong>The scoop via Joost Schuur:</strong><br />
Rasmus is talking about an &#8216;opcode cache&#8217;. It essentially caches the parsed PHP scripts in memory. That means PHP doesn&#8217;t have to read it from disk or even convert the humanly readable PHP script code into executable machine code (opcode). The one he&#8217;s referring to is APC, which is likely going to be included in the next big release of PHP. Xcache is another popular kind. I run it on my site and got about a 3x performance increase on page request server times, so the numbers add up. The W3 Total Cache WordPress plugin has the option of using Xache or APC to keep popular pages in memory via opcode caching.</p>
<p><small><a href="http://vimeo.com/13768954" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/08/digg-technical-talks-rasmus-lerdorf/" 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/08/digg-technical-talks-rasmus-lerdorf/">Permalink</a> | <a href="http://digwp.com/2010/08/digg-technical-talks-rasmus-lerdorf/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/08/digg-technical-talks-rasmus-lerdorf/&title=Digg Technical Talks &#8211; Rasmus&nbsp;Lerdorf">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><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/WI2_xPn8g6s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/digg-technical-talks-rasmus-lerdorf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://vimeo.com/13768954</feedburner:origLink></item>
		<item>
		<title>Randomized Grid of Posts</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/NiM8un9qmxM/</link>
		<comments>http://digwp.com/2010/08/randomized-grid-of-posts/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 15:31:11 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[archives]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2673</guid>
		<description><![CDATA[I&#8217;m all about tinkering with different ideas to display posts with WordPress. After all, it&#8217;s just a bunch of data at our fingertips! WordPress makes it easy to output whatever we need. Not long ago we experimented with making a Thumbnail Based Archives. Now let&#8217;s build a Randomized Grid Archives. 1. Create a page template, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m all about tinkering with different ideas to display posts with WordPress. After all, it&#8217;s just a bunch of data at our fingertips! WordPress makes it easy to output whatever we need. Not long ago we experimented with making a <a href="http://digwp.com/2010/07/thumbnail-based-archives/">Thumbnail Based Archives</a>. Now let&#8217;s build a <a href="http://digwp.com/archives/grid/">Randomized Grid Archives</a>.</p>
<p><img src="http://digwp.com/wp-content/uploads/gridexample.jpg" alt="" title="gridexample" width="590" height="337" class="alignnone size-full wp-image-2668" /></p>
<p><span id="more-2673"></span></p>
<h3>1. Create a page template, publish a page</h3>
<p>We need a totally unique page template to work with. So create a new one. You know, just make a file like grid-archives.php in your theme and put this PHP comment at the top and then WordPress will recognize it. Then create a new page, pick this template, and publish it. The name and content absolutely don&#8217;t matter, just put something there so you can recognize/find it later.</p>
<pre><code>&lt;?php
/*
Template Name: Thumb Archives - Grid
*/
?&gt;</code></pre>
<h3>2. Loop it</h3>
<p>This is pretty much the entire page. We&#8217;ll link out to an external stylesheet for styling. Then we run a Loop for 25 posts (in our demo, we also remove our link style posts). Each post is an anchor tag, and within, the post title, the post image thumbnail, and the excerpt.</p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
	&lt;meta charset="UTF-8" /&gt;
	&lt;title&gt;Grid Archives | Digging Into WordPress&lt;/title&gt;
	&lt;link rel="stylesheet" type="text/css" media="all" href="&lt;?php bloginfo("template_url"); ?&gt;/css/gridarchives.css" /&gt;
&lt;/head&gt;

&lt;body&gt;
	&lt;div id="page-wrap"&gt;
		&lt;?php query_posts('posts_per_page=25&amp;cat=-52'); ?&gt;
		&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
			&lt;a href="&lt;?php the_permalink(); ?&gt;" class="box col&lt;?php echo rand(2,4); ?&gt;"&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;?php endwhile; endif; ?&gt;
	&lt;/div&gt;
&lt;/body&gt;
	
&lt;/html&gt;</code></pre>
<h3>3. Masonize</h3>
<p>Notice in the HTML above we echo&#8217;d out a random number between 2 and 4 as part of a class name. The results classes will be: col-2, col-3, and col-4. These represent columns. So each link box is &#8220;randomized&#8221; based on this class name. Some post link boxes are 2 columns wide, others 3, others 4. Font sizing and thumbnail sizing also adjusts accordingly.</p>
<pre><code>.box { margin: 10px; float: left; }
.box:hover { outline: 2px solid white; }
.box:hover .title { background: none; }
.box:hover .ex { background: none; color: white; }
.box:hover img { opacity: 0.4; }

.col2 { width: 180px; }
.col3 { width: 280px; }
.col4 { width: 380px; }

.col2 img { max-width: 80px; float: right; margin: 0 0 2px 10px; }
.col3 img { max-width: 100px; float: left; margin: 0 10px 2px 0; }
.col4 img { max-width: 120px; float: right; margin: 0 0 2px 10px; }

.title { background: #237abe; color: white; display: block; padding: 10px; overflow: hidden; }
.col2 .title { font-size: 16px; }
.col3 .title { font-size: 18px; }
.col4 .title { font-size: 20px; }

.ex { background: white; color: #222; display: block; padding: 10px; }
.col2 .ex { font-size: 11px; }
.col3 .ex { font-size: 12px; }
.col4 .ex { font-size: 13px; }</code></pre>
<p>So each of those post link boxes is just floated to the left. That&#8217;s going to make a pretty ragged and nasty layout all by itself, because each box will be a different height depending on the length of the title and excerpt. No problem though, we&#8217;re going to rearrange the boxes using the <a href="http://desandro.com/resources/jquery-masonry/">jQuery Masonry plugin</a> by David DeSandro. We&#8217;ll just call jQuery, the plugin, and the write a quick script to call it. This can go pretty much anywhere on the page. Typically jQuery is run on DOM ready, but in this case we are waiting for the window&#8217;s load event, because we want to wait for the thumbnails to load before masonizing.</p>
<pre><code>&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.masonry.min.js'&gt;&lt;/script&gt;
&lt;script&gt;
 $(window).load(function() {
   $("#page-wrap").masonry({
      columnWidth: 100, 
      animate: true, 
      animationOptions: {
          duration: 300,
          queue: false
      }
  });
 });
&lt;/script&gt;</code></pre>
<h3>Enjoy!</h3>
<p><a href="http://digwp.com/archives/grid/">Here is ours.</a> Let us know if you play with this on your own site at all.</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/08/randomized-grid-of-posts/">Permalink</a> | <a href="http://digwp.com/2010/08/randomized-grid-of-posts/#comments">13 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/08/randomized-grid-of-posts/&title=Randomized Grid of&nbsp;Posts">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/grid/" rel="tag">grid</a>, <a href="http://digwp.com/tag/jquery/" rel="tag">jquery</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/NiM8un9qmxM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/randomized-grid-of-posts/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/08/randomized-grid-of-posts/</feedburner:origLink></item>
		<item>
		<title>Easy Comment Management via SQL</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/fY5hwkeWkh8/</link>
		<comments>http://digwp.com/2010/08/wordpress-sql-comments/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 16:55:44 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2027</guid>
		<description><![CDATA[Here are some sweet SQL code snippets for easy comment management. Sometimes it&#8217;s easier to modify comment status and delete unwanted comments on a sitewide basis. Using a program like phpMyAdmin makes it so easy to do stuff like remove spam, close/open comments on old posts, enable/disable pingbacks for specific time periods, and so on. [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some sweet <abbr title="Structured Query Language">SQL</abbr> code snippets for <strong>easy comment management</strong>. Sometimes it&rsquo;s easier to modify comment status and delete unwanted comments on a <em>sitewide</em> basis. Using a program like <a href="http://www.phpmyadmin.net/">phpMyAdmin</a> makes it so easy to do stuff like remove spam, close/open comments on old posts, enable/disable pingbacks for specific time periods, and so on. Just remember to <a href="http://codex.wordpress.org/Backing_Up_Your_Database" title="WordPress Codex: Backing Up Your Database">backup your database</a> before running any queries.</p>
<h3>Remove all spam comments from the database</h3>
<p>This <abbr title="Structured Query Language">SQL</abbr> query removes all comments marked as &ldquo;spam&rdquo; from the database:</p>
<p><code>DELETE FROM wp_comments WHERE wp_comments.comment_approved = 'spam';</code></p>
<p>Works great in all versions of WordPress including 3.0!</p>
<p><span id="more-2027"></span></p>
<h3>Disabling and enabling comments</h3>
<p>In the WordPress database, the &ldquo;<code>wp_posts</code>&rdquo; table includes a column called &ldquo;<code>comment_status</code>&rdquo;, which may contain one of the following values for each row (i.e., post):</p>
<ul>
<li><code>open</code> (comments open to everyone)</li>
<li><code>closed</code> (comments closed to everyone)</li>
<li><code>registered_only</code> (comments open for registered/logged-in users)</li>
</ul>
<p>Given this information, we may execute the following <acronym title="Structured Query Language">SQL</acronym> queries (via phpMyAdmin or any other method of querying the database) to manipulate our discussion-management settings for comments (note: remember to backup your database):</p>
<h4>Globally enable comments for all users</h4>
<pre><code>UPDATE wp_posts SET comment_status = 'open';</code></pre>
<h4>Globally disable comments for all users</h4>
<pre><code>UPDATE wp_posts SET comment_status = 'closed';</code></pre>
<h4>Globally enable comments for registered users only</h4>
<pre><code>UPDATE wp_posts SET comment_status = 'registered_only';</code></pre>
<h4>Globally enable/disable comments before a certain date</h4>
<p>For this query, specify the <code>comment_status</code> as either <code>open</code>, <code>closed</code>, or <code>registered_only</code>. Also, specify the date by editing the <code>2008-01-01</code> to suit your needs.</p>
<pre><code>UPDATE wp_posts SET comment_status = 'closed' WHERE post_date &lt; '2008-01-01' AND post_status = 'publish';</code></pre>
<p>I run this query a few times each year (or as often as I can remember it) to disable comments on old posts. Ultimately, I will combine this query with a similar one (provided below) for pingbacks and trackbacks to manage discussion options with a single step.</p>
<h3>Disabling and enabling Trackbacks &amp; Pingbacks</h3>
<p>Similar as before, the &ldquo;<code>wp_posts</code>&rdquo; table also includes a column called &ldquo;<code>ping_status</code>&rdquo;, which applies to both pingbacks and trackbacks, and may contain one of the following values for each row (i.e., post):</p>
<ul>
<li><code>open</code> (pingbacks/trackbacks open to everyone)</li>
<li><code>closed</code> (pingbacks/trackbacks closed to everyone)</li>
</ul>
<p>Given this information, we may execute the following <acronym title="Structured Query Language">SQL</acronym> queries (via phpMyAdmin or any other method of querying the database) to manipulate our discussion-management settings for pingbacks and trackbacks:</p>
<h4>Globally enable pingbacks/trackbacks for all users</h4>
<pre><code>UPDATE wp_posts SET ping_status = 'open';</code></pre>
<h4>Globally disable pingbacks/trackbacks for all users</h4>
<pre><code>UPDATE wp_posts SET ping_status = 'closed';</code></pre>
<h4>Globally enable/disable pingbacks/trackbacks before a certain date</h4>
<p>For this query, specify the <code>ping_status</code> as either <code>open</code> or <code>closed</code>. Also, specify the date by editing the <code>2008-01-01</code> to suit your needs.</p>
<pre><code>UPDATE wp_posts SET ping_status = 'closed' WHERE post_date &lt; '2008-01-01' AND post_status = 'publish';</code></pre>
<p>As before, this last query is one that I will be using a few times each year (or as often as I can remember it) to disable comments on old posts. Ultimately, I will combine this query with the comments query to produce the one-step discussion-management query provided below.</p>
<h3>Complete, one-step discussion management</h3>
<p>Given the queries described above, we may fashion the following &ldquo;one-step&rdquo; <acronym title="Structured Query Language">SQL</acronym> queries, perfect for complete, plugin-free discussion management:</p>
<h4>Globally enable/disable all discussion: comments, pingbacks and trackbacks</h4>
<p>For this query, specify the <code>comment_status</code> as either <code>open</code>, <code>closed</code>, or <code>registered_only</code>. Also, specify the <code>ping_status</code> as either <code>open</code> or <code>closed</code>.</p>
<pre><code>UPDATE wp_posts SET comment_status = 'open', ping_status = 'open' WHERE comment_status = 'closed' AND post_status = 'publish';</code></pre>
<h4>Globally enable/disable comments, pingbacks and trackbacks before a certain date</h4>
<p>For this query, specify the <code>comment_status</code> as either <code>open</code>, <code>closed</code>, or <code>registered_only</code>. Also, specify the <code>ping_status</code> as either <code>open</code> or <code>closed</code>. Finally, specify the date by editing the <code>2008-01-01</code> to suit your needs.</p>
<pre><code>UPDATE wp_posts SET comment_status = 'closed', ping_status = 'closed' WHERE post_date &lt; '2008-01-01' AND post_status = 'publish';</code></pre>
<p>That last query is perfect for manual control over the closing of both comments and xbacks for posts from a specific time period. Sure there are plugins for this, but there are also plugins that enable direct SQL commands, making it convenient for granular control over discussion intervals. </p>
<p>Here are some more <a href="http://digwp.com/2010/03/remove-replace-content-wordpress-database/" title="Remove/Replace Content from the WordPress Database">awesome SQL techniques</a>!</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/08/wordpress-sql-comments/">Permalink</a> | <a href="http://digwp.com/2010/08/wordpress-sql-comments/#comments">8 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/08/wordpress-sql-comments/&title=Easy Comment Management via&nbsp;SQL">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/admin/" title="View all posts in Admin" rel="category tag">Admin</a> | Tagged: <a href="http://digwp.com/tag/database/" rel="tag">database</a>, <a href="http://digwp.com/tag/mysql/" rel="tag">mysql</a>, <a href="http://digwp.com/tag/sql/" rel="tag">sql</a>, <a href="http://digwp.com/tag/tips/" rel="tag">tips</a>, <a href="http://digwp.com/tag/tricks/" rel="tag">tricks</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/fY5hwkeWkh8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/wordpress-sql-comments/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/08/wordpress-sql-comments/</feedburner:origLink></item>
		<item>
		<title>Using Menus in WordPress 3.0</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/V9qIOV0ePJo/</link>
		<comments>http://digwp.com/2010/08/using-menus-in-wordpress-3-0/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 15:12:37 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2637</guid>
		<description><![CDATA[The menu system in WordPress 3.0 was hotly anticipated. But perhaps unbeknownst to many average WordPress users, actually using this feature takes some coding work. In fact, even enabling the features take a bit of code. Below we&#8217;ll go through the steps for inserting a custom menu into your theme. Note that many themes will [...]]]></description>
			<content:encoded><![CDATA[<p>The menu system in WordPress 3.0 was hotly anticipated. But perhaps unbeknownst to many average WordPress users, actually using this feature takes some coding work. In fact, even enabling the features take a bit of code.</p>
<div class="image-wrap">
<img src="http://digwp.com/wp-content/uploads/wpmenusnoactive.png" alt="" title="wpmenusnoactive" width="450" height="143" class="size-full wp-image-2638" />
</div>
<p>Below we&#8217;ll go through the steps for inserting a custom menu into your theme. Note that many themes will have menu functionality built-in. This is for Do-It-Yourself folks who are trying to add it to their existing theme.</p>
<p><span id="more-2637"></span></p>
<h3>1. Register menus in functions.php file</h3>
<pre><code>if ( function_exists( 'register_nav_menus' ) ) {
  	register_nav_menus(
  		array(
  		  'foot_menu' =&gt; 'My Custom Footer Menu',
  		  'sidebar_menu' =&gt; 'Super Sidebar Menu'
  		)
  	);
}</code></pre>
<div class="image-wrap">
<img src="http://digwp.com/wp-content/uploads/menuspresent.png" alt="" title="menuspresent" width="450" height="128" class="alignnone size-full wp-image-2639" />
</div>
<h3>2. Create menu in Admin</h3>
<p>Now that the feature is enabled, go to Appearance > Menus and build and save a custom menu.</p>
<p><img src="http://digwp.com/wp-content/uploads/menus-step2.png" alt="" title="menus-step2" width="590" height="463" class="alignnone size-full wp-image-2640" /></p>
<h3>3. Attach custom menu to your &#8220;declared&#8221; menu</h3>
<p>Now that you&#8217;ve declared a menu (in functions.php) and built a menu (in the admin), you&#8217;ll need to connect them to each other.</p>
<p><img src="http://digwp.com/wp-content/uploads/menu-step3.png" alt="" title="menu-step3" width="590" height="463" class="alignnone size-full wp-image-2641" /></p>
<h3>4. Insert the menu into the theme</h3>
<p>Now anywhere in your theme you want to display that menu, use:</p>
<pre><code>&lt;?php wp_nav_menu( array('menu' =&gt; 'Footer Menu' )); ?&gt;</code></pre>
<p>Change the name of the menu in the code above to match whatever you named the menu in the admin. This very site uses a WordPress 3.0 menu in the footer. The output HTML looks like this:</p>
<pre><code>&lt;ul class="menu" id="menu-footer-menu"&gt;&lt;li class="menu-item menu-item-type-post_type menu-item-2636" id="menu-item-2636"&gt;&lt;a href="http://digwp.com/contact/"&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-item menu-item-type-post_type menu-item-2633" id="menu-item-2633"&gt;&lt;a href="http://digwp.com/about/"&gt;About&amp;nbsp;Site&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-item menu-item-type-post_type menu-item-2634" id="menu-item-2634"&gt;&lt;a href="http://digwp.com/advertising/"&gt;Advertising&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-item menu-item-type-post_type menu-item-2635" id="menu-item-2635"&gt;&lt;a href="http://digwp.com/archives/"&gt;Archives&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<h3>5. Rejoice</h3>
<p>Now any time this menu needs to be updated, we can do it from the comfort of the WordPress admin area.</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/08/using-menus-in-wordpress-3-0/">Permalink</a> | <a href="http://digwp.com/2010/08/using-menus-in-wordpress-3-0/#comments">31 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/08/using-menus-in-wordpress-3-0/&title=Using Menus in WordPress&nbsp;3.0">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/function/" rel="tag">function</a>, <a href="http://digwp.com/tag/menu/" rel="tag">menu</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/V9qIOV0ePJo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/using-menus-in-wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/08/using-menus-in-wordpress-3-0/</feedburner:origLink></item>
		<item>
		<title>WordPress Update: 3.0.1</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/urcQ6puLsi8/</link>
		<comments>http://digwp.com/2010/08/wordpress-update-3-0-1/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 08:00:53 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2648</guid>
		<description><![CDATA[Just a reminder that WordPress version 3.0.1 is available, so take a few moments and update your website. Staying current is one of the best ways to keep things running smooth, safe and secure. The new version addresses about 50 minor issues and helps to make WordPress 3.0 even better. Amazingly, WordPress 3.0 was downloaded [...]]]></description>
			<content:encoded><![CDATA[<p>Just a reminder that WordPress version 3.0.1 is available, so take a few moments and <strong>update your website</strong>. Staying current is one of the best ways to <em>keep things running smooth, safe and secure</em>. The new version addresses about 50 minor issues and helps to make WordPress 3.0 <em>even better</em>.</p>
<p>Amazingly, WordPress 3.0 was downloaded <strong>nearly 11 million times</strong> in 42 days. So HUGE congrats and thanks to the entire WordPress crew for an amazing piece of software.</p>
<p><small><a href="http://wordpress.org/news/2010/07/wordpress-3-0-1/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/08/wordpress-update-3-0-1/" 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/08/wordpress-update-3-0-1/">Permalink</a> | <a href="http://digwp.com/2010/08/wordpress-update-3-0-1/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/08/wordpress-update-3-0-1/&title=WordPress Update:&nbsp;3.0.1">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><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/urcQ6puLsi8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/wordpress-update-3-0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://wordpress.org/news/2010/07/wordpress-3-0-1/</feedburner:origLink></item>
		<item>
		<title>WordPress E-Junkie Plugin</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/Ckr2EZ4p-28/</link>
		<comments>http://digwp.com/2010/07/wordpress-e-junkie-plugin/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 23:07:35 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2646</guid>
		<description><![CDATA[We use E-Junkie ourselves on this site to sell the book. This plugin brings to two together to theoretically make that process easier. Direct Link to Article &#8212; Permalink on DiWLike the article? Get the book! © 2010 Digging into WordPress &#124; Permalink &#124; Comments &#124; Add to Delicious Categorized: Links &#124; Tagged:]]></description>
			<content:encoded><![CDATA[<p>We use E-Junkie ourselves on this site to sell the book. This plugin brings to two together to theoretically make that process easier.</p>
<p><small><a href="http://wpejunkie.com/wp-junkie-demo/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/07/wordpress-e-junkie-plugin/" 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/wordpress-e-junkie-plugin/">Permalink</a> | <a href="http://digwp.com/2010/07/wordpress-e-junkie-plugin/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/07/wordpress-e-junkie-plugin/&title=WordPress E-Junkie&nbsp;Plugin">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><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/Ckr2EZ4p-28" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/07/wordpress-e-junkie-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://wpejunkie.com/wp-junkie-demo/</feedburner:origLink></item>
	</channel>
</rss>
