WordPress.org

Ready to get started?Download WordPress

Forums

Changing default options for multiple WP installations? (9 posts)

  1. Miroslav
    Member
    Posted 7 years ago #

    Hi all,

    Hope, someone will be able to help...

    I am moving my sites to WordPress. I have installed and set up my first blog successfully. Now, I am ready to move on to my other sites and would like to use the same options setup.

    Is there a way to make custom options setup part of the installation procedure, so that I don't have to change the default options for each new blog?

    In other words, is there a way to change the default options setup to a custom one BEFORE I install the blog?

    Thanks in advance for your help! :)

    Miroslav

  2. Miroslav
    Member
    Posted 7 years ago #

    Anyone?

  3. pizdin_dim
    Member
    Posted 7 years ago #

    Yeah, there's one way to do it: hack the "install.php" file and change the values there.

  4. Miroslav
    Member
    Posted 7 years ago #

    Thanks, pizdin_dim! :)

    I suppose, I could also hack any of the options_*.php or other files in the /wp-admin/ directory?

  5. Jean-Pierre Michaud
    Member
    Posted 7 years ago #

    if you go read the wp-admin/upgrade-schema.php, you wil find all the schema for the database, and the default settings for each feature... so it's the proper place to modify things... no need to edit anyother file before installation of your blogs.

    the install.php file is just for adding latest content to the database, it's not the install process itself...

  6. Miroslav
    Member
    Posted 7 years ago #

    Thanks, nexia! This is exactly what I am after! :)

    Any quick hint on how to modify the file, as not to mess up things? Say, I want to have the permalinks turned on by default using a custom URL structure. How would I modify the upgrade-schema.php file?

    I am assuming that I should modify the code on line 190:

    add_option('permalink_structure');

    ... but what do I do with it?

    Thanks for your help! :)

  7. pizdin_dim
    Member
    Posted 7 years ago #

    "so it's the proper place to modify things... no need to edit anyother file before installation of your blogs."

    That's not true, strictly speaking. There are a bunch of things which could be changed in "install.php", which affect defaults:

    1. default links
    2. default category
    3. first post
    4. default comment
    5. first page
    6. admin username

    I recommend always changing (2) and especially (6) in almost all installations I've done so far.

  8. Miroslav
    Member
    Posted 7 years ago #

    Now, I am curious what the outcome of this discussion will be...

    The way I see it, the install.php file contains only limited number of options that can be modified and, yes, it does make sense to modify the default admin username (for security purposes).

    However, for my purposes, I need more than just the 6 options available in the install.php file. This includes, among others:

    - custom permalinks structure
    - admin nickname
    - use of rich text editor
    - admin email
    - blog URL (include "www" as default)
    - activated plugins
    - etc.

    I suppose, these can be modified only in the upgrade-scheme.php file, so I would need to modify both files.

    Btw, where does WP store the selected options AFTER the installation? None of the files discussed above seem to be written to.

  9. pizdin_dim
    Member
    Posted 7 years ago #

    "I suppose, these can be modified only in the upgrade-scheme.php file, so I would need to modify both files."

    Yes, that's correct.

    "Btw, where does WP store the selected options AFTER the installation? None of the files discussed above seem to be written to."

    In the database "options" table mainly. The user info is kept in the "users" table.

Topic Closed

This topic has been closed to new replies.

About this Topic