Where do I put this code to enable email as username in Multisite?

Hi, I need to paste this code someplace, but I don’t know into which file to paste it. It allows an email address to be used as the Username in Multisite. Also open to any other suggestions for accomplishing this same goal. Thanks, Sherry



* WordPress register with email only, make it possible to register with email

* as username in a multisite installation

* @param Array $result Result array of the wpmu_validate_user_signup-function

* @return Array Altered result array


function custom_register_with_email($result) {

if ( $result != ” && is_email( $result ) ) {

unset( $result->errors );


return $result;