≡ Menu

WordPress: Disable Post Revisions / Turn Off Revisions

How do I disable post revisions feature found in wordpress version 2.6.x and v3.x.x based blog site?

By default, post revisions are enabled for all wordpress based blog. It will save copies of each edit made to a post. This allows the possibility of reverting to a previous version of that post. However, you can turn off the feature by editing wp-config.php file. This file is located in your blog directory. You can download this file using the ftp command or ftp client. If you’ve ssh access directly edit the file using a text editor such as vi or nano. Make sure you backup wp-config.php file.

How do I disable post revisions?

In this example, I’m going to edit the file using ssh client. Type the following command to login to your vps / vm / server called server1.cyberciti.biz using Mac OS X or Unix like operating systems:

ssh vivek@server1.cyberciti.biz

My blog is located at /nas05/httpd/vhost/cyberciti.biz. So cd into /nas05/httpd/vhost/cyberciti.biz:

cd /nas05/httpd/vhost/cyberciti.biz
### make a backup ###
cp wp-config.php wp-config-backup.php

Edit a file called wp-config using a text editor called vi:
vi wp-config.php
Append the following directive:

define('WP_POST_REVISIONS', false );


define('WP_POST_REVISIONS', 0 );

Save and close the file. Here is my sample wp-config.php file:

define('WP_CACHE', true);
define('WP_POST_REVISIONS', 0);
// ** MySQL settings ** //
define('DB_NAME', 'blog');    // The name of the database
define('DB_USER', 'dbuser');     // Your MySQL username
define('DB_PASSWORD', 'mypassword'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
// You can have multiple installations in one database if you give each a unique prefix
$table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
// 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', '');
define('AUTH_KEY',         'removed-for-security');
define('SECURE_AUTH_KEY',  'removed-for-security');
define('LOGGED_IN_KEY',    'removed-for-security');
define('NONCE_KEY',        'removed-for-security');
define('AUTH_SALT',        'removed-for-security');
define('SECURE_AUTH_SALT', 'removed-for-security');
define('LOGGED_IN_SALT',   'removed-for-security');
define('NONCE_SALT',       'removed-for-security');
/* That's all, stop editing! Happy blogging. */
define('ABSPATH', dirname(__FILE__).'/');
Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 0 comments… add one }
Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , ,