Forums

Deleting a user role (14 posts)

  1. HotJoint
    Member
    Posted 1 year ago #

    So, i installed this plugin wich created a new role: "Administer Web Shop" and then i uninstalled it. Sadly this role is still there and i cant find a solution to how i can remove it.

    I had search here in the forums and in the plugins directory but i couldnt find anything.

    Anyone can tell me what i have to do to delete this user role or if theres any plugin to do it?

    Thanx in advace!

  2. elfin
    Moderator
    Posted 1 year ago #

    reinstall the plugin you used and delete the role. then uninstall that plugin again.

  3. HotJoint
    Member
    Posted 1 year ago #

    But the plugin doesnt allow me to delete the role. it doesnt have that option.

    Or do i misunderstood something here?

    Thanx

  4. elfin
    Moderator
    Posted 1 year ago #

    ahh sorry, misunderstood I thought you'd added that yourself via a plugin.

    Due to the way its stored deleting via phpmyadmin is a bad idea. So you'll need to look for a role scoper type plugin that allows you to delete it.

  5. HotJoint
    Member
    Posted 1 year ago #

    I was looking around for one but i couldnt find any. Maybe can u refer me to one that can actually delete roles?

    Via phpMyAdmin if any1 gimme the to-do list i can do it aswell

    This is stored only in the BD or in the code aswell? i mean the base code of WP not the plugin

  6. elfin
    Moderator
    Posted 1 year ago #

    http://wordpress.org/extend/plugins/search.php?q=role&sort=

    if you can't find one that does the job, let us know.

  7. HotJoint
    Member
    Posted 1 year ago #

    I tryed with each one of those and nothing, it seems its impposible to delete a role! lol

    Rich: Does the plugins insert code into WP source files? Someone told me once that plugins does not write any code on WP core files and works using their files stored on each folder, is this true?

    And plz help me out to delete this god damn role!

    Thanx

  8. HotJoint
    Member
    Posted 1 year ago #

    ok the problem was an user were assigned to that role so i couldnt delete it. Now i fix it, leaving no users there and with a plugin i did it. Thanx for the support!

    Can u answer my question of the plugin codes?

    Thanx! :)

  9. elfin
    Moderator
    Posted 1 year ago #

    no plugins don't, or at least shouldn't, alter core files.

  10. HotJoint
    Member
    Posted 1 year ago #

    ok thanx!

  11. Julio Araya
    Member
    Posted 1 year ago #

    To delete a wordpress user role you need use this two lines:

    $wp_roles = new WP_Roles();
    $wp_roles->remove_role("your_role");

    if you want to list the roles before delete one of them:

    $wp_roles = new WP_Roles();
    $names = $wp_roles->get_names();
    print_r($names);

    no plugins needed, 100% guaranted!

  12. candy2012
    Member
    Posted 10 months ago #

    @Julio - cool, if you would have also mentioned WHERE to insert those lines, they might have been useful ...

  13. Ace of Spades
    Member
    Posted 7 months ago #

    @candy2012 ,it can go in your theme's functions.php file, a plugin file, etc. Put it in a function. Whatever.

  14. Kenny
    Member
    Posted 7 months ago #

    @Julio, you are a genius. Threw it in my header.php and refreshed my site once to make it run. Then deleted the code. I 2nd your 100% guarantee!

Topic Closed

This topic has been closed to new replies.

About this Topic