Posts Tagged Wordpress

Disable WordPress Autosave

WordPress’ Autosave feature was getting on my nerves. Often I make several revisions of a page before I save and WordPress was saving intermediate drafts that I didn’t want to keep.

I was surprised to find that there is no option in WordPress core to disable Autosave. Thankfully though it is incredibly easy to disable through editing the source or creating a custom plugin.

The following code (take from the reference link below) will function as a WordPress plugin and will disable autosave (works in WordPress 2.8)

<?php
/*
Plugin Name: Disable Autosave
*/
function disable_autosave() {
wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disable_autosave' );
?>

References

Adjust WordPress Autosave or Disable It Completely

Tags: ,

Migrating WordPress to Unicode

Considering that internationalisation is all the rage (and the chance I may be using multibyte characters in the future) I decided to migrate my WordPress database to unicode, more specifically UTF8.

Until recently, fresh installs of MySQL defaulted to latin1_swedish for the character set. This is all fine and dandy if you are using regular English characters, but causes trouble if you try to use any multibyte characters.

Migrating the database should not be difficult, and the script found here further simplifies the process to a point-and-click affair.

A few technical difficulties

The database will not let you alter the columns to blobs from variable length strings whilst they are part of indexes, so many of the convert-to-blob commands will fail.

You could manually delete the indexes that include varchar/text columns, and then recreate them after. Whilst tedious, it would only take you about 15-30mins.

But since I knew that I had not used any non-ascii characters in my posts, I skipped the convert-to-blob commands and just brute-forced all the tables and columns to UTF8. (If I had any foreign characters, they would have been corrupted by taking this shortcut).

Tags: , ,