• Hello

    i created a custom role. I gave him the capability “create users”

    when a user of that role logs in, he can create users from profile page.

    I do not need that. I have already made a custom way to create users through another page.

    The question is, how do i get rid of create user page through profile and so the registered user can create users only with my custom code?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Anonymous User 13528887

    (@anonymized-13528887)

    You can do something like,

    $role = get_role( 'author' ); // Replace this with your own custom role
    $role->remove_cap( 'add_users' );
    Thread Starter dourvas

    (@dourvas)

    hello, thanks for answearing

    I do not want to remove add_user capability from the role. I want to maintain this capability.

    I just want the user with that role to create users through my custom page and not through his profile page

    Thread Starter dourvas

    (@dourvas)

    ok,
    if i remove the capability from the role the create user tab dissappears from profile page and my custom page still can create users.

    I am having a role that does not have the capability to create users but through my custom page (programmaticaly using wp_insert_user) it creates.

    Is something i am missing? It should work this way?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘remove add users from profile’ is closed to new replies.