How to add WordPress user using php code

Content of the article

Sometimes its necessary to create a new user on WordPress site using PHP code (for example not possible access to email and password doesn works, etc ...). Below is code which will do this work:

Drop the code in index.php of the site, or in functions.php file of the current wp theme, refresh any page of the site and then remove this script from the place you dropped it. Now its possible to login into the site using credentials: demo/demo.

 

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments