The MU forums have moved to WordPress.org

how to make "users must be registered to comment" on by default? (4 posts)

  1. redbox
    Member
    Posted 17 years ago #

    I'd like the option for "users must be registered and logged in to comment" on by default for new blogs. Is this possible?

  2. zappoman
    Member
    Posted 17 years ago #

    The default value of this is set in the "populate_options()" function found in the file upgrade_schema.php. This function is called when a new blog is created to set its default values.

    There is a line that says...


    add_option('comment_registration', 0);

    Change the 0 to 1, and it should do the trick. Blogs that were previously created will not be effected. If you want to change those you could do some direct SQL manipulation of each blogs something like this....


    UPDATE wp_2_options w SET option_value = 1 WHERE option_name = 'comment_registration';

    Assuming you want to change blog_id 2 and your table prefix is "wp_".

    Good Luck.

  3. zappoman
    Member
    Posted 17 years ago #

    btw, if you want to do this without making direct core changes, you can theoretically implement a new version of wp_install() and wp_install_defaults() which are both pluggable.

  4. redbox
    Member
    Posted 17 years ago #

    Thanks very much for your help :)

About this Topic