Localhost install: Administrator lost administrator access; cannot access Dashboard

I have been building a WordPress-based website in my localhost (‘localhost/dzup_online/wordpress’) for a week now and I have been accessing the Dashboard several times now without fail. (Theme: Twentysixteen (default))

I installed another WordPress site for checking out other themes (‘localhost/dzup_online_4/wordpress’). (Theme: Clean Journal Child theme (user-made))

Since working on the ‘dzup_online_4’ website, I decided to make it my main website so I switched the names of their root directories (‘dzup_online’ <- -> ‘dzup_online_4’)

Of course, my website broke so I had to update wp-config.php to change ‘DB_NAME’, ‘DB_USER’ and $table_prefix (‘wp_’ -> ‘dzup_wp’) to point to the other database and database user. (The passwords for both database users are the same) (I also did the same for the other website) I also added the correct privileges for the database for each database user.

I updated ‘dzup_wp_options’ in the database for the ‘option_name’s ‘siteurl’ and ‘home’ to reflect the new root folder name for the website.

I renamed the database tables to be prefixed with the name $table_prefix (‘dzup_wp_’).

I also replaced the ‘guid’s of the posts in ‘dzup_wp_posts’ with the new root folder name.

At this point, I can access my home page quite fine and can access my Dashboard as an administrator.

I tried switching pages and found out that I had to modify my .htaccess too. This is the new content:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dzup_online/wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dzup_online/wordpress/index.php [L]
</IfModule>

# END WordPress

I refreshed the page and suddenly, I do not see the Dashboard menu button in the Admin Bar anymore.

I reverted back to my old .htaccess but my administrator account seems to have still lost administrator rights.

I tried adding a new user through this tutorial but the newly added user still cannot access the Dashboard.

I renamed the ‘meta_key’s in ‘dzup_wp_usermeta’ table to have the new table prefix at the start with the following values:

dzup_wp_capabilities a:1:{s:13:”administrator”;b:1;} dzup_wp_user_level 10

For both user accounts, I still do not have administrator rights.

I hope you can help me with this. Thanks!

Solutions

The {$table_prefix}user_roles entry in the options table must begin with the actual table prefix.

Your website was with a prefix of wp_ so the entry was called wp_user_roles . When modifying the table prefix you need to change it with the new one:

dzup_wp_user_roles

Hope it works !

Similar questions

Can't access WordPress dashboard unless Administrator
Our non-Administrator (Shop Manager, Editor, Author, etc) users cannot access the WordPress/Woocommerce dashboard. Administrators can access the dashboard. I have tried logging in users as "out of the box" Shop Managers, Authors, Editors, and they get bumped back to the storefront. I have tried disabling plugins, and using the basic woo theme to no...
What are the differences in capabilities between the super-administrator and administrator?
What are the capabilities that a super-administrator has that an administrator does not have? The codex page on user capabilities does not have a list of capabilities of the super-admin. It lists only the capabilities of the administrator.
current_user_can('Administrator') does not return true in multisite if user is Administrator but NOT Super Admin
I have a multisite WordPress installation set up, and have a user who is set to an 'Administrator' role on both sites. However, the function current_user_can('Administrator') does not return true when logged in as them, which I expected it to. My user account, however, is an 'Administrator' on both sites, and also a 'Super Admin' on the network, an...
How do I change Administrator to Super Administrator
How does one change an Administrator to Super Administrator in cpanel for a Wordpress site? I have gone into the databases and into wp-users, wp-usermeta, but still cannot figure out how it's done. Context - a PHP developer who worked on the site changed the Super admin to Administrator and I need to set the person back to Super. Any input is appre...
Change Administrator to Super Administrator (multi-site)
Could someone help me how to change Administrator to Super Administrator on a multi-site?
How can i extract administrator from a:1:{s:13:"administrator";b:1;} while fetching from mysql database?
this is my SQL query and I get a:1:{s:13:"administrator";b:1;} but need only administrator.

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy .