Tag Archives: HowTo

WordPress, Disable and Delete Post Revisions

Post revisions are one of the more useless features of WordPress that do little but add bloat to the database.

At first they were kind of cool, but then what do you do with them?

You’re not running a wiki. Right?

Here is how to get rid of them once and for all.

Edit wp-config.php, add this line in to disable the post revisions feature.

define('WP_POST_REVISIONS', false);

You will also need to clean the database of all the previous entries under the wp_posts and wp_postmeta tables.

use database_name;
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision';

Congratulations, you are done! Enjoy your now much smaller database.

HowTo: Change VMWare Player Guest OS Display Resolution

Here is one useful bit for anyone running, or thinking of running, a local test/development environment under VMWare Player version 2.0 with a guest OS Linux install.

I’ll assume you have installed VMWare Player and a VMWare Appliance similar to CentOS v5. After which, by default, the resolution will be limited to modes “800×600″ and “640×480″.

Here is how you fix that problem…

Step 1: Install X and GNOME, if not already present.
yum groupinstall "X Window System" "GNOME Desktop Environment"
[Note: to install KDE, substitute the "GNOME..." string with "KDE (K Desktop Environment)"]

Step 2: Edit /etc/X11/xorg.conf

You should already have…

Section "Device"
Identifier "Videocard0"
Driver "vmware"
EndSection

Add the following “monitor” section…

Section "Monitor"
Identifier "Monitor0"
HorizSync 1.0 - 10000.0
VertRefresh 1.0 - 10000.0
EndSection

Modify the existing “Screen” section…
Note to replace the following “1600×1200″ string with the highest resolution your monitor can handle.

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1600x1200" "800x600" "640x480"
EndSubSection
EndSection

Step 3: Start X
startx