You do not have sufficient permissions to access this page.

I've locked myself our of two sites. Not certain the cause but I ascribe it to hardening the sites with Defender. I can no longer login is as admin so cannot grant support but i do have ftp, file manager and phpmyadmin access. Can you provide a way to troubleshoot resolve?

http://localistanews.com
http://www.megamixer.com

  • Nastia
    • Support Rock Star

    Hello Erik

    I'm sorry to hear about this!

    The issue here can be many things. Please clear your browser from cache and cookies and test again.

    Would you please access the wp-content folder via FTP and rename the plugins folder to something like plugins-deactivate. Will you able to access your site again?

    If not, please send to us your credentials so I can have a closer look?

    Please send them using our secure contact page:
    https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me.

    Send in:

    Subject: "Attn: Nastia”
    - WordPress admin username
    - WordPress admin password
    - login url
    - FTP credentials (host/username/password)
    - link back to this thread for reference
    - any other relevant urls

    Let us know how it went!

    Cheers,
    Nastia

  • Nastia
    • Support Rock Star

    Hello Erik

    I hope you are doing well today!

    I can confirm the issue on your site. It looks strange, I can login but the user looks like doesn't have administrator role.

    Please make sure that the information inside the wp-config.php file it's correct. Check the database name, database user name, database password, and database host. See this link: http://codex.wordpress.org/Editing_wp-config.php

    Also, make sure that the database table prefix in your config.php matches the table name prefixes in your database.

    Than, please visit the phpMyAdmin, locate wp_usermeta table, check the wp_capabilities, it should be set as :

    a:1:{s:13:"administrator";s:1:"1";}

    And wp_user_level value should be 10.

    I hope this helps!

    Cheers,
    Nastia

  • Erik
    • Site Builder, Child of Zeus

    I deleted everything form htaccess except to WP settings
    I checked the table prefix and it is set correctly.

    wp_capabilities: a:2:{s:13:"administrator";b:1;s:13:"bbp_keymaster";b:1;}
    wp_user_level: 10

    Still get error: "You do not have sufficient permissions to access this page."

    As I stated everything started after I used Defender possibly after renaming tables.

  • Erik
    • Site Builder, Child of Zeus

    I should also mention that I looked in the wp_metatable and it shows that my last activity was just now. This indicates that the tables are being read and written to.

    Also, I changed the wp-capabilities to a:1:{s:13:"administrator";s:1:"1";} with the same result

  • Sajid
    • DEV MAN’s Sidekick

    Hi Erik,
    Hope you are doing good today :slight_smile:

    Thanks for sending in the credentials. It appears that WordPress does not consider the login user as administrator.

    What you can do here is create a new administrator user with administrator role manually via phpMyadmin. If you are not sure how to do that then please take a look at following article:
    http://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,
    Sajid

  • Erik
    • Site Builder, Child of Zeus

    I followed the instructions exactly. New admin user created successfully. Still encounter the exact same message.

    I delved deeper and discovered that the Defender Hardener Table Prefix modifier failed to complete the task and thus locked my out of my site. The tables were all renamed but the references to table names within options and metadata were only partially changed and my admin user was not changed.

    This article saved the day: http://www.wpbeginner.com/wp-tutorials/how-to-change-the-wordpress-database-prefix-to-improve-security/ as it put me on the correct path.

    The problem that I have now is that, after manually fixing the admin user records I thought I could go into the prefix option and change it again (assuming it would finish this time) but the Hardener prefix is disabled since I already ran it once.

    How can I run the prefixe changer again?

  • Sajid
    • DEV MAN’s Sidekick

    Hi Erik,
    Hope you are doing good today :slight_smile:

    The defender plugin checks, if and only if the current db prefix is wp_ then it will show the issue in list and let you change the prefix.

    In this case, if you had prefix changed successfully by following the other method then I am not sure why you want to change it again.

    But in case you still want to do that, then please follow the steps below:

    1. Go to following location:
    ../wp-content/plugins/wp-defender/app/module/hardener-module/component/

    2. Take backup of class-wd-db-prefix.php file here.

    3. Now download this file and open up with text/code editor.

    4. Find below code on nearly line number 32.
    public function check( $against = 'wp_' ) {

    5. Right after the above link (with a line bread) add following code (see screenshot):
    return false;

    6. Save the changes and upload the file back to server.

    Now you will see this option in the list and could change the prefix. Make sure you remove that code from the file otherwise it will keep displaying the issue in not resolved list.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,
    Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.