SQL to check how many sites a user is a member of

You could simply use the get_blogs_of_user() function:

echo count( get_blogs_of_user( $user_ID ) );

instead of your custom SQL query.

Leave a Comment