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__).'/');

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum