Change WordPress user roles and capabilities Forums How to or FAQ completely remove user role editor from database

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3344
    berd0029
    Participant

    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)?

    #3346
    Vladimir
    Keymaster

    Hi,

    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.

    #3348
    berd0029
    Participant

    Is 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.

    #3349
    Vladimir
    Keymaster

    Correct, 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.