Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Lost Admin Privileges – Getting WordPress Admin Access Back

by

Tips and Tricks HQ Support Portal › Forums › General Stuff › Instructions/F.A.Q › Lost Admin Privileges – Getting WordPress Admin Access Back

Tagged: access, admin, administrative privileges, permission, restore admin

  • This topic has 0 replies, 1 voice, and was last updated 8 years, 1 month ago by admin.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • January 30, 2015 at 10:47 pm #12143
    admin
    Keymaster

    How to get the WordPress admin access back

    It is very easy to get the WordPress admin access back (if you have lost it somehow).

    You just need to update a value in the “wp_usermeta” table of your WordPress database.

    The following image should explain what value needs to be updated in the “wp_usermeta” database table (you can update the database value by going to cPanel->PHPMyAdmin of your website):

    http://images.tipsandtricks-hq.com/forum-images/user_meta.JPG

    If you look at the wp_usermeta table you can see that there is a column “wp_capabilities” for the User ID “1” (this is the admin users id in my case).

    Now look at the value of this “wp_capabilities” column and put the same in yours and it should give you admin access back.

    1. open the “wp_usermeta” table and find the “wp_capabilities” entry for the admin user (the user ID will allow you to verify). Now edit the value for the correct “wp_capabilities” row and update it’s value with the following:

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

    That should do it.

    Alternative Method Using PHP

    You can use the following PHP code to create a user with admin access.

    $user = new WP_User('','myusername');
    $user->set_role('administrator');

    Change “myusername” to the username you want to use.

    Log in to your site via FTP and add the above code to your theme’s functions.php file. Then load any page on the site. It will run the code and create the account with admin privileges. Make sure to remove the code after you’re done (this is very important). After that, you can login as that user and reset everything.

  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ