iThemes Security (formerly Better WP Security)
[Plugin: Better WP Security] Database prefix quirk (2 posts)

  1. jacob.tingen
    Posted 3 years ago #


    I updated the prefix to my database table to resolve some other problems I was having with the Gravity Forms plugin. Anyway, after updating the database table, then I had a problem with User Roles. I figured out what the problem was, but I wanted to share the solution and see if this is a potential bug that can also be fixed.


    I have a WPMU setup. I had sites where users were not displaying on the user page. Also, when I attempted to add users, I could not indicate which user role the new user should be given because the drop down just didn't display.

    How I Fixed It

    I dug into my database, went to the specific MU blog and selected the "wpprefix_options" table. The "user_roles" entry had the wrong database prefix. I updated the prefix to the user_roles entry and my user roles and capabilities returned for that blog/site.

    Why I'm sending a support request to you even though I fixed my problem

    The prefix on the "user_roles" entry wasn't the original "wp_". It was a prior database prefix assigned by Better WP Security when I used it to automatically change my database tables previously.

    So my question is, is there a way to make sure that the "user_roles" prefix matches the new database prefix when someone automatically changes the database prefix using Better WP Security? Is this a feature that can be added to future versions?

    Also, is there a way to easily fix all of my "user_role" prefixes? Because I have other sites on this same WPMU install suffering from the same problem, and I would rather not go through each one individually. I only know enough about databases to make trouble and fix the occasional problem. Any help?


  2. Thank you for the report. I had thought this fixed a few issues back (hadn't heard about it since). I'll take a look again and see if I can make the login work a little better.

    As for a quick way to fix...

    ...What I've done in these situations is create a dump of the database, do a search replace, and re-upload the dump as the curent database. You'll be down for a couple of minutes but it has worked for me (just keep the original dump in case anything is corrupted so that you can restore.).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic