custom wordpress install automation

Discussion in 'Blogging' started by linkbarrett, Nov 13, 2009.

  1. linkbarrett

    linkbarrett Newbie

    Joined:
    Jun 25, 2009
    Messages:
    12
    Likes Received:
    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.
     
    • Thanks Thanks x 3
  2. Scripteen

    Scripteen Elite Member

    Joined:
    Sep 19, 2009
    Messages:
    1,810
    Likes Received:
    1,919
    Home Page:
    Too bad it can't be done with fantastico :( still good though.
     
  3. youngguy

    youngguy BANNED BANNED

    Joined:
    Apr 11, 2009
    Messages:
    1,055
    Likes Received:
    1,560
    hey! Nice find OP! Thanks man!
     
  4. K1w12k3

    K1w12k3 Junior Member

    Joined:
    Feb 13, 2009
    Messages:
    116
    Likes Received:
    393
    You can also install and auto-activate plugins using this method. Saves a *lot* of time when you install autoblogs.
     
  5. ballhogjoni

    ballhogjoni Newbie

    Joined:
    Aug 19, 2010
    Messages:
    1
    Likes Received:
    0
    How do I auto install and activate plugins using this install.php file?