When user registers to my site I want to make them inactive by default so I can manually update their status and send them their login info. I am using wordpress 3.1.2. Is it possible? Are there any plugins for this?

BTW, I am using Cimy User Extra Field plugin to add more fields to the registration page.

1 Answer 1

Plugin Name: Role-less New Users
Description: Removes all roles from new registrations.
Author: 5ubliminal
// Hook into the registration process
add_action('user_register', function($user_id){
    $user = new WP_User($user_id);
    // Remove all user roles after registration
    foreach($user->roles as $role){
}, 11);

Create a new .php file. Paste the code above in it. Put it in your /wp-content/plugins folder and activate it. Do test it!

PS: Be advised, PHP 5.3 syntax, closures used. Incompatible with PHP 5.2 or older.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.