← All recipes

Search for User by Email Address

Searches for a WordPress user account by email address. Will return the name of the site if found.

read -r -d '' php_code << heredoc
<?php
\$user = get_user_by( "email", "[email protected]" );
if ( \$user ) {
    \$site = get_home_url();
    echo "Found user on \$site";
}
heredoc

echo -n "$php_code" > hunt_user_by_email.php

wp eval-file hunt_user_by_email.php
rm hunt_user_by_email.php

Be sure to replace [email protected] with the email address you are searching for.

Run it across a fleet

Open the console in CaptainCore Manager, pick the target sites, choose this recipe from the Cookbook picker and press run. The CLI streams each site's output back to the dock.

About the console →