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!
reinstall the plugin you used and delete the role. then uninstall that plugin again.
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
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.
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
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
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! :)
no plugins don't, or at least shouldn't, alter core files.
HotJoint
Member
Posted 1 year ago #
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!
candy2012
Member
Posted 10 months ago #
@Julio - cool, if you would have also mentioned WHERE to insert those lines, they might have been useful ...
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.
@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!