Azharkamar.com

2 Useful WordPress Admin Hacks

Snippets
17 Apr 2011
Comment

I’ve been using WordPress for just almost 2 years and there are generally 2 features that I would love to change in the WordPress admin. First is the autosave feature and second, the post revisions. These are great features, by the way, but they can be further tweaked for more comfort.

The autosave function saves your post frequently and this can protect your data, but unfortunately a bit too frequent. As for the post revisions feature, it’s saving way too much post revisions and this behavior can cause the accumulation of a fair bit of unwanted space in your database without you realizing.

So here are some code snippets you can add on to your wp-config.php file to improve the features stated above.

How to Increase the Autosave Interval

autosave
Here’s a short line of code you can add to your wp-config.php file to increase the post autosave interval in WordPress.

Open the wp-config.php file (in the root folder) and add this line of code at the bottom:

/* increase autosave interval */
define('AUTOSAVE_INTERVAL', 600); // 10 minutes (60 seconds x 10)

How to Reduce or Disable Post Revisions

post-revisions
To limit the number of post revisions, add the following to your wp-config.php file:

/* limit post revisions */
define('WP_POST_REVISIONS', 5); // Maximum 5 revisions

To disable post revisions (not recommended):

/* disable post revisions */
define('WP_POST_REVISIONS', false);

Author - Azhar Kamar

Write a Comment! NOW! :)

Current ye@r *