• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

PHP Code To Add New User in WordPress

This solution enables you to add a new user via your functions file.

The code enables you to set the following:

  • The username
  • The password
  • The email address
  • The role

add-new-user

You can use this code to create a new administrator or add any number of users via your functions file, a plugin, theme or MU folder.

If, for some reason you cannot reset your password, you might want to use this solution.

Simply add the following PHP to your functions file and it will create a new user with administrator access:

Register for full access

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems