Title: Set default admin settings
Last modified: August 22, 2016

---

# Set default admin settings

 *  Resolved [Andrew](https://wordpress.org/support/users/snd26/)
 * (@snd26)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/set-default-admin-settings/)
 * Hi,
 * This question probably seems unnecessary and I’m not sure if it is actually possible
   to do as I have searched how to do this everywhere.
 * I am trying to set a couple of admin settings to new default values so when users
   first sign up, admin settings are set to different values to what the default
   wordpress values are.
 * For example, The closest I have come is setting default values like this:
 *     ```
       //Admin: Discussions: Users must enter name and email to comment - set to no
       update_option( 'require_name_email', '0' );
   
       //Admin: Discussions: Only registered users can comment - set to yes
       update_option( 'comment_registration', '1' );
   
       //Admin: Discussions: Comments - set to descending
       update_option( 'comment_order', 'desc' );
       ```
   
 * These work but the only problem is the above codes forces the new values so users
   can’t change them. I’m looking for a way that does the job above but users can
   still change them.
 * The same way you can set a default header and default background but users can
   still change them, example:
 *     ```
       $defaults = array(
       	'default-image'        => network_site_url() . 'path to header image.jpg',
       );
       add_theme_support( 'custom-header', $defaults );
       ```
   
 * The above code sets a default header image and users can change it in appearance
   > header. I’m trying to do the same thing but for admin settings.
 * Any help appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [Bet Hannon](https://wordpress.org/support/users/bethannon1/)
 * (@bethannon1)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/set-default-admin-settings/#post-5598551)
 * Would using the plugin [User Role Editor](https://wordpress.org/plugins/user-role-editor/),
   creating a specially defined role, and then making the default user that role
   do what you need to do?
 *  [David Sader](https://wordpress.org/support/users/dsader/)
 * (@dsader)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/set-default-admin-settings/#post-5598587)
 * If you want a nice user interface in the admin to set the changes in your Network
   Dashboard,
 *  then I offer: [https://wordpress.org/plugins/wpmu-new-blog-defaults/](https://wordpress.org/plugins/wpmu-new-blog-defaults/)
 * You will want to fork it for your own purposes – especially to bring it up to
   the current WP version.
 *  [David Sader](https://wordpress.org/support/users/dsader/)
 * (@dsader)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/set-default-admin-settings/#post-5598588)
 * If you only want a couple lightweight changes, then your own /mu-plugin/ code
   might look something like this:
 *     ```
       <?
       add_action('wpmu_new_blog', 'ds_new_blog_settings');
       function ds_new_blog_settings($blog_id) {
       	update_option( 'require_name_email', '0' );
       	update_option( 'comment_registration', '1' );
       	update_option( 'comment_order', 'desc' );
       }
       ?>
       ```
   
 *  Thread Starter [Andrew](https://wordpress.org/support/users/snd26/)
 * (@snd26)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/set-default-admin-settings/#post-5598653)
 * Thanks for your comments.
 * That wpmu_new_blog is probably what I’m looking for, I’ll see if I can get it
   working similar to how how you suggested.
 * Hopefully it will work first time, if not, it looks like I’m going to be creating
   a lot of test users.
 *  Thread Starter [Andrew](https://wordpress.org/support/users/snd26/)
 * (@snd26)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/set-default-admin-settings/#post-5598681)
 * So I think I created about 100 test blogs until I finally got it to work:
 *     ```
       function am_admin_defaults( $blog_id ) {
           /* tests */
               update_blog_option( $blog_id, 'posts_per_page', '33' );
       	update_blog_option( $blog_id, 'comment_whitelist', '0' );
               update_blog_option( $blog_id, 'comment_registration', '1' );
       }
       add_action( 'wpmu_new_blog', 'am_admin_defaults' );
       ```
   
 * //http://codex.wordpress.org/WPMU_Functions/update_blog_option
 * I’ll mark this as resolved, I don’t do a lot of coding so if anyone sees a problem
   with this code let me know.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Set default admin settings’ is closed to new replies.

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 5 replies
 * 3 participants
 * Last reply from: [Andrew](https://wordpress.org/support/users/snd26/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/set-default-admin-settings/#post-5598681)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
