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.sxi.io using Mac OS X or Unix like operating systems:

ssh vivek@server1.sxi.io

My blog is located at /nas05/httpd/vhost/sxi.io. So cd into /nas05/httpd/vhost/sxi.io:

cd /nas05/httpd/vhost/sxi.io
### 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__).'/');

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Make Website WCAG Compliant?

Next Post

Link download Kali Linux 2020.1 (ISO + Torrent)

Related Posts