Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8526279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:13:39+00:00 2026-06-11T08:13:39+00:00

We have a site with three additional user roles which we added to the

  • 0

We have a site with three additional user roles which we added to the WP default roles. The “member” role is much like the “subscriber” role while the “backstage” and “artist” roles mirror the “contributor” role. The custom roles we are using are organizational, facilitate group emails, etc. These custom roles have the same capabilities as the default role they mirror.

I need to allow users to change roles when updating their profiles.

I can’t seem to find in which table roles are stored. Any help in any of this is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:13:40+00:00Added an answer on June 11, 2026 at 8:13 am

    I think wp_usermeta table has a role field on user. To get a role from admin you can use:

    $role = get_option('default_role');  //(fetch admin seted role) then insert like
    
    $userdata = array('user_login' => $username,
                     'user_nicename' => $fname,
                     'user_email' => $email,
                     'display_name' => $fname,
                     'nickname' => $fname,
                     'first_name' => $fname,
                     'last_name' => $lname,
                     'description' => $aboutme,
                     'user_url' => $website,
                     'role' => $role
    );
    
    $user_id = wp_insert_user($userdata);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my site, I have three roles: Role 1 Role 2 Role 3 Role
I have an ASP.NET site which I'd like to add page-level comments to without
my site has three div elements, header, content and footer. i have a picture
i have many urls(string): $one = 'http://www.site.com/first/1/two/2/three/3/number/342'; $two = '/first/1/two/2/number/32'; $three = 'site.com/first/1/three/3/number/7'; $four
I would like to ask you: Imagine that you have a site and there
I have three pages in my WordPress site: About, Voices & History. These are
I am working on a webby, which would need unique user identification like IP/MAC
I'm working on a site, which will have several modules that either fully available
I would like to have a aspect of my site that users can use
I have a site where there will be a list of offers that the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.