I’m using wordpress for a large non-profit with many sites. I’d like to decrease the amount of installation steps for the people setting up their sites. Is it possible to make a WP install that automatically activates the plugins, themes and default content I choose?

2 s
2

Sure. wp_install_defaults() is a pluggable function. (As are wp_new_blog_notification() and wp_upgrade(), in case you ever need to override those too.)

# in wp-config.php
if ( defined('WP_INSTALLING') && WP_INSTALLING ) {
  include_once dirname(__FILE__) . '/wp-content/install.php';
}

# in wp-content/install.php
function wp_install_defaults($user_id) {
  global $wpdb, $wp_rewrite, $current_site, $table_prefix;
  // do whatever you want here...
}

Leave a Reply

Your email address will not be published. Required fields are marked *