custom wordpress install automation

linkbarrett

Newbie
Joined
Jun 25, 2009
Messages
12
Reaction score
6
I just found out this cool trick for customizing wordpress during install. This saves a lot of time if you're installing a bunch of sites. For example, I like to disable comments and enable XML-RPC posting. All you have to do is stick a file "install.php" in your wp-content folder. Inside, put something like this:

PHP:
<?php

function wp_install_defaults($user_id) {
        update_option('default_comment_status', 'closed');
        update_option('permalink_structure', '/%year/%month%/%postname%/');
        update_option('default_ping_status', 'closed');
        update_option('enable_xmlrpc', '1');
}
?>

You get the idea. Check out the function wp_install_defaults in wp-admin/includes/upgrade.php for more things you can do, like adding pages and posts. Big time saver.
 
Too bad it can't be done with fantastico :( still good though.
 
You can also install and auto-activate plugins using this method. Saves a *lot* of time when you install autoblogs.
 
Back
Top