Support » Fixing WordPress » Sorry, you are not allowed to access this page

Viewing 15 replies - 16 through 30 (of 31 total)
  • Hey, could anyone please explain how to add the row wp_user_roles in wp_options table as it is missing in my case..

    Thank you!!!

    the ‘Give’ plugin update decided to take instead and replaced all user_roles with it’s own permissions.

    Sigh!

    For those who experience this because of a migration that included changing your wp prefix, you also need to update your _usermeta table otherwise it will not work.

    If you have access to the database, e.g. in PHPMyAdmin, you can use something like this (update newprefix and oldprefix as applicable):

    UPDATE newprefix_options SET option_name = REPLACE(option_name, ‘oldprefix_’, ‘newprefix_’) WHERE option_name LIKE ‘%oldprefix_%’;

    UPDATE newprefix_usermeta SET meta_key = REPLACE(meta_key, ‘oldprefix_’, ‘newprefix_’) WHERE meta_key LIKE ‘%oldprefix_%’;

    Note that in this case, the wp_user_roles row is in the _options table, but you need to update the prefix otherwise it produces the same error.

    • This reply was modified 1 year, 1 month ago by semyl.
    AmaZulu

    (@amazulu)

    I’m now experiencing this issue for the first time after 15 years of never seeing it on WP ever.

    I have looked at the wp_user_roles option in the table and it is there, but it has different values to what has been suggested as replacement by an earlier poster. If I simply replace what is in the field with the other values is this not going to completely screw up the whole thing?

    Thank you so much!!

    @semyl Bingo! Thanks so much for that. No matter how long you do WP, there’s always something that gets you 🙂

    @gerard70 Very happy to help! Had only just figured it out myself at the time of posting.

    Adding my thanks as well for @padreed123

    Agreed, this should be the first search result over everything else that was attempted first.

    My issue was a “premium” car rental plugin that corrupted the user_roles entry when deactivated.

    I recommend that for others using this solution, and if there were additional user roles created by plugins such as Yoast SEO or WooCommerce, to deactivate and reactivate those plugins. This will recreate user roles specific to those plugins (bonus is they won’t kill your site when deactivated).

    KONG84

    (@kong84)

    thanks! Was so good to find a solution here. Saved me hours of work.
    Big big thank you!

    Thanks for help!

    thank you so much , my problem solved in my case the value was ot the probkrn but the prefix it sself

    This post is still helping people today!!

    Like @urek2019 – I didnt have the row missing, but your post made me check the right area.

    I synced the DB’s with WP Syncro plugin, and that row in the DB had taken on the prefix from the live server. So changing from wpij_ to just wp_ fixed me login permissions problem 🙂

    Thank’s padreed123 (@padreed123)!!!!

    I altered prefix tables and forgot to update row wp_user_roles in table wp_options.

    To fix I executed in mysql:

    UPDATE wp_options SET option_name = REPLACE( option_name , ‘fd_’, ‘wp_’ );

    faizacef00

    (@faizacef00)

    Hi @padreed123 I just followed your instruction…it run on mysql finely but still i cann’t get access as andministrator to my site.Im currently using bitnami plateform on which i run the query.But it didn’t work for me.Any idea how can i do that?

    semyl

    (@semyl)

    @faizacef00 Did you try what I described as a fix, from 10 months ago?

Viewing 15 replies - 16 through 30 (of 31 total)
  • You must be logged in to reply to this topic.