How to filter post titles

If you know that you will want to apply a filter to all of your post titles in WordPress, such as forcing uppercase, lowercase, or title capitalization, you can use a filter to do so. The filter below will force a title to lowercase as the post is saved:

[code lang=”php”]
if ( !function_exists( ‘ucc_post_title_filter’ ) ) :
function ucc_post_title_filter( $data ) {
$title = $data[‘post_title’];

$title = strtolower( $title );
$data[‘post_title’] = $title;

return( $data );
}
add_filter( ‘wp_insert_post_data’ , ‘ucc_post_title_filter’ );
endif;
[/code]

On line 5, strtolower() can be exchanged for any text-transforming function.

Yummy Trees

Thank goodness I’m nutty about aggregating my links back to my site, because otherwise I’d have lost them all in the great [Ma.gnolia](http://ma.gnolia.com/) database fail of 2009. As it stands, I just had to dig up my [Delicious](http://delicious.com/) password and update my [Postalicious](http://wordpress.org/extend/plugins/postalicious/) plugin settings. It only took four months for me to actually do that.

Links For 13 August 2008

[Adjust WordPress autosave or disable it completely](http://www.untwistedvortex.com/2008/06/27/adjust-wordpress-autosave-or-disable-it-completely/)
: Instructions for methods that disable or delay the WP autosave functions.

[Delete WordPress 2.6 revisions](http://andreineculau.com/blog/2008/07/delete-wordpress-26-revisions/)
: Instructions for disabling WP 2.6 revisions and deleting the offending rows in wp_posts, wp_postmeta, and wp_termrelationships.