Change WordPress user roles and capabilities › Forums › How to or FAQ › completely remove user role editor from database
- This topic has 3 replies, 2 voices, and was last updated 7 years, 10 months ago by Vladimir.
-
AuthorPosts
-
13/02/2017 at 17:29 #3344berd0029Participant
Hello, I changed the url of my multisite network using the plugin updraftpro. On the new site I also changed the prefix to my database tables (this was a bad idea to do during import). There was a field in site options on each site that listed the table of the user roles, but it didn’t get updated to the new prefix.
I manually changed most of them, but now user role editor won’t show up in “Users” menu. Clearly something is still not right.
I would like to completely remove all traces of user role editor from the database and start fresh.
I’m hoping for guidance on a mysql query that I can run in phpmyadmin that will do this. Keep in mind there is some metadata for user role editor that lists the wrong table prefixes.
Would just deleting the plugin remove all metadata (even with wrong table prefixes)?
14/02/2017 at 04:00 #3346VladimirKeymasterHi,
Example below is shown for the default db prefix ‘wp_’.
1st, WordPress core stores user roles with capabilities at wp_options db table at option name ‘wp_user_roles’:
SELECT * FROM wp_options WHERE option_name='wp_user_roles';
If db prefix was changed, WP will not find its user roles.
2nd, look at the user-role-editor-pro/uninstall.php
You will see there where URE Pro stores its settings and additional modules data and how to delete theme using SQL tool.It does not prevent access to the Users->User Role Editor menu. It seems you lost user roles, so try to change user roles option_name value using new db prefix.
14/02/2017 at 04:39 #3348berd0029ParticipantIs there a way to make “select * FROM wp_options” for wordpress multisite. My tables are wp_12_options, wp_13_options, wp_14_options etc.
How would I access user-role-editor/uninstall.php? When I got to /wp-content/plugins/user-role-editor-pro/uninstall.php I just get a blank white page.
Strangely I have not lost the Users->user role editor on the child sites, just at the network level.
The plugin is network activated.
14/02/2017 at 04:50 #3349VladimirKeymasterCorrect, every subsite at WP multisite has its own options table db_prefix + blog_id + ‘options’. So we have to make select against every wp_i_options table for every subsite.
uninstall.php is executed inside WP only when you delete plugin at “Plugins” page by click at the ‘Delete’ link. I offered to look at the code to get the idea, where URE stores its data.
Do you see any roles at subsites? Just to check lost you them or no after db prefix change.
I suppose that you have access to “Network admin->Plugins”. So you can network deactivate “User Role Editor Pro”. Click ‘Delete’ under its row after that to fully delete User Role Editor Pro.
1st, try to network deactivate/activate back User Role Editor Pro. Plugin tries to restore its own user capabilities at activation in case they are lost.
-
AuthorPosts
- You must be logged in to reply to this topic.