WordPress – How to remove a large number of email-bounced users

One of my wordpress web sites has over 20,000 users. Most of these users were verified when they signed up for their account, but there are still a large number of bounce email I get every time I send out a user mailing. There are also a number of “unsubscribe” messages that I get.

I searched around for a plug-in that would allow me to upload a CSV file and would then bulk-delete the users but none was found. Instead of creating a new plug-in I decided to figure out a way of doing some form of bulk removal of users. Here is what I did (note: my site does not have any “contributor” users):

  1. For each bounce email or unsubscribe request I receive I copy the email address
  2. Execute this query in your wordpress database:[quote style=”boxed”] update wp_usermeta SET meta_value=’a:1:{s:11:”contributor”;s:1:”1″;}’ where meta_key=’wp_capabilities’ AND user_id= (SELECT ID from wp_users where user_email=’theuser@example.com’);[/quote]
  3. I repeat that for all users
  4. Go to the Users panel, click on “Contributors”
  5. Click the check mark all
  6. Bulk Delete

Again, this works for me because everyone is a “Subscriber” and the “Contributors” list is always empty so I use that to store my temporary delete list.

Fix for the WordPress Theme Studiopress for WordPressMU

The Studiopress theme for WordPressMU is broken. When you try to update the options you get the message “options page not found”. I have fixed the issue:
> if ( is_admin() ){ // admin actions
> add_action(‘admin_init’, ‘register_mysettings’ );
> } else {
> // non-admin enqueues, actions, and filters
> }
> function register_mysettings() { // whitelist options
>   register_setting( ‘Theme Options’, ‘greeting’ );
>   register_setting( ‘Theme Options’, ‘welcomemessage’ );
> }
<   <div class=’wrap’>

>   <div>
> <?php settings_fields(‘greeting,welcomemessage’); ?>
<   <p><input type=”submit” name=”Submit” value=”Update Options” /></p>

>   <p><input type=”submit” name=”Submit” value=”<?php _e(‘Update Options’); ?>” /></p>
> <?php settings_fields( ‘Theme Options’ ); ?>
< ?>
\ No newline at end of file

> ?>