skip to Main Content

I have this WP error message instead of user_id : Not enough data to create this user. I am trying to create a new user programmatically. This code works on another project I worked on, but returns an error on the current one am working on.

the code

$user_id = wp_create_user( $username, $password, $email );
        

         

2

Answers


  1. Chosen as BEST ANSWER

    Turns out the issue was WP Cerber Plugin. Disabled it and now everything works.


  2. It means that the $user does not return the user object, but false which means wp_create_user is probably returning an error object.

    Check the wp_create_user arguments!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search