<?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>Itsonlybarney ... &#187; WordPress</title>
	<atom:link href="http://itsonlybarney.com/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://itsonlybarney.com</link>
	<description>Hate is my middle name ...</description>
	<lastBuildDate>Wed, 01 Sep 2010 05:30:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Disabling WordPress Post Revisions</title>
		<link>http://itsonlybarney.com/wordpress/disabling-wordpress-post-revisions.html</link>
		<comments>http://itsonlybarney.com/wordpress/disabling-wordpress-post-revisions.html#comments</comments>
		<pubDate>Tue, 10 Aug 2010 01:00:11 +0000</pubDate>
		<dc:creator>Barney</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.itsonlybarney.com/?p=9</guid>
		<description><![CDATA[I know that I said that this blog would be primarily about rantings, however for those of you who run your own self-hosted WordPress installation, you may find that post revisions are annoying, and tend to fill up your database relatively quickly. So this is how you go about disabling the revision feature within WordPress, [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I know that I said that this blog would be primarily about rantings, however for those of you who run your own self-hosted WordPress installation, you may find that post revisions are annoying, and tend to fill up your database relatively quickly.</p>
<p>So this is how you go about disabling the revision feature within WordPress, <strong>and</strong> turning off the Auto-Save feature when creating pages and posts.  There are methods out there that require you to edit core WordPress files, and I am against that due to having to reapply the changes with each upgrade.</p>
<h4>Disable Post Revisions</h4>
<p>To disable post revisions for all future posts, we simply need to add one line to our <em>wp-config.php</em> file.</p>
<pre>define( 'WP_POST_REVISIONS' , false );</pre>
<p>That is it, simply add that line to your <em>wp-config.php</em> file, and the post revision feature will be disabled.  It would be nice to be able to turn it off from within the WP Admin panel, however that is a choice the dev team has made.</p>
<p>If you are now choosing to disable this feature on an existing blog with many existing posts and revisions saved to the database, you can remove these post revisions with the following SQL command within your database editor such as phpMyAdmin:</p>
<pre>DELETE FROM wp_posts WHERE post_type = "revision";</pre>
<p>Simply replace the wp_ with your database prefix for your WP site.</p>
<h4>Disable AutoSave</h4>
<p>As previously mentioned, you can comment out the Autosave feature within the core WP files, however to maintain the simple one click upgrade, add the following to a PHP file within your plugins folder, and the AutoSave feature will be disabled while the plugin is activated.</p>
<pre>&lt;?php
/*
Plugin Name: Disable Autosave
*/

function disable_autosave() {
	wp_deregister_script('autosave');
}
add_action('wp_print_scripts' , 'disable_autosave');
?&gt;
</pre>
<p>I&#8217;ve bundled this file into a <a href="http://itsonlybarney.com/wp-content/uploads/disable_autosave.zip">downloadable ZIP</a> file you can simply upload to your blog through the add plugin page of the Admin Panel. </p>
<p><a href="http://itsonlybarney.com/wp-content/uploads/disable_autosave.zip"><img class="aligncenter" src="http://itsonlybarney.com/wp-content/uploads/download.png" alt="Download Disable AutoSave Plugin" width="100" /></a></p>
<p>So there you have it, you can disable the revisions and autosave features of WordPress without having to edit core WordPress files following each upgrade.</p>
]]></content:encoded>
			<wfw:commentRss>http://itsonlybarney.com/wordpress/disabling-wordpress-post-revisions.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
