How to optimize WordPress wp_usermeta table?

I’m trying to optimize a WordPress site which has around 13,000 users. Currently each new user adds approximately 20 rows to the wp_usermeta table, so queries involving that table are starting to get slow. We don’t use many of the meta_keys that are added for each user, so I’d like to delete them.

Examples:

Read More
jabber
googleplus
twitter
yim

I’m wondering if these are added by the WP core, or if they’re from one of my plugins. If they are from the core, is there any harm in removing them? Is there an elegant way to prevent new ones from getting generated?

Related posts

Leave a Reply

1 comment

  1. You can easily remove the user fields. But make sure that the theme is not using those fields.

    function my_user_fields( $contactmethods ) {
        //Remove user fields
        unset($contactmethods['yim']);
        unset($contactmethods['aim']);
        unset($contactmethods['jabber']);
    
        //Add user fields
        $contactmethods['user_gtalk'] = 'GTalk';
        $contactmethods['user_facebook'] = 'Facebook';
        $contactmethods['user_twitter'] = 'Twitter';
        $contactmethods['user_google'] = 'Google+';
        $contactmethods['user_linkedin'] = 'LinkedIn';
    
        return $contactmethods;
    }
    
    add_filter('user_contactmethods','my_user_fields',10,1);