with my plugin, I have a login form. I use the wp_login_form() function of Wordpress.

As you know, this function links to the wp-login page. But if the user_login is not present or if the email is empty in the database, an error will be present.

My users come from an external database. Imagine the following situation: A user from my external database connects for the first time on the site, so he is not in the wp_users table of Wordpress. When he goes to submit, I would like him to add the user in the wp_users table before being logged in because he exists in my external database.

Do you have an idea for the interception, or for another way to do it?

Thanks in advance for the answers


1 Answer 1


Thanks @Buttered_Toast !

The answer was to use the wp_authenticate hook and put my custom function as argument. I should have thought about it...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.