Free Digital Courses 1 min a Day

Designed for learners of all ages. Easy to understand. Deaf-friendly.

Start upgrading your skills today!

[WooCommerce Store] How to Fix “Sorry, You Are Not Allowed to Access This Page” in WordPress Admin Login

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Recently my client experienced such a problem. He was unable to log into his admin dashboard, and the screen displayed “Sorry, You Are Not Allowed to Access This Page”. One can imagine the panic, especially when you need to fulfill backend orders.

While helping him to troubleshoot this problem, I came across many websites with similar solutions. One good example would be this: https://kinsta.com/knowledgebase/sorry-you-are-not-allowed-to-access-this-page-error-in-wordpress/

Some websites offer 10 ways while others 7 ways. They are mostly similar. I tried everything possible, and nothing worked.

I was so glad when I saw a different solution in a forum: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-sorry-you-are-not-allowed-to-access-this-page-error-in-wordpress/

Look for the answer by this user: padreed123

That solution was such a gem. It worked!

And it deserves more limelight, not hidden in a multitude of questions and answers. So here goes:

padreed123

(@padreed123)

2 years, 10 months ago

Ok after countless hours of examining wp_options tables in phpmyadmin I finally discovered the problem. Somehow the wp_user_role row got deleted. It can also happen if it is edited/changed by a plugin such as WooCommerce.

So to fix it I copied the following from a fresh install and inserted it into the wp_options table with phpmyadmin:
Remember to replace ‘wp_’ with your db prefix.

option_name
wp_user_role

option_value

a:5:{s:13:”administrator”;a:2:{s:4:”name”;s:13:”Administrator”;s:12:”capabilities”;a:61:{s:13:”switch_themes”;b:1;s:11:”edit_themes”;b:1;s:16:”activate_plugins”;b:1;s:12:”edit_plugins”;b:1;s:10:”edit_users”;b:1;s:10:”edit_files”;b:1;s:14:”manage_options”;b:1;s:17:”moderate_comments”;b:1;s:17:”manage_categories”;b:1;s:12:”manage_links”;b:1;s:12:”upload_files”;b:1;s:6:”import”;b:1;s:15:”unfiltered_html”;b:1;s:10:”edit_posts”;b:1;s:17:”edit_others_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:10:”edit_pages”;b:1;s:4:”read”;b:1;s:8:”level_10″;b:1;s:7:”level_9″;b:1;s:7:”level_8″;b:1;s:7:”level_7″;b:1;s:7:”level_6″;b:1;s:7:”level_5″;b:1;s:7:”level_4″;b:1;s:7:”level_3″;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:17:”edit_others_pages”;b:1;s:20:”edit_published_pages”;b:1;s:13:”publish_pages”;b:1;s:12:”delete_pages”;b:1;s:19:”delete_others_pages”;b:1;s:22:”delete_published_pages”;b:1;s:12:”delete_posts”;b:1;s:19:”delete_others_posts”;b:1;s:22:”delete_published_posts”;b:1;s:20:”delete_private_posts”;b:1;s:18:”edit_private_posts”;b:1;s:18:”read_private_posts”;b:1;s:20:”delete_private_pages”;b:1;s:18:”edit_private_pages”;b:1;s:18:”read_private_pages”;b:1;s:12:”delete_users”;b:1;s:12:”create_users”;b:1;s:17:”unfiltered_upload”;b:1;s:14:”edit_dashboard”;b:1;s:14:”update_plugins”;b:1;s:14:”delete_plugins”;b:1;s:15:”install_plugins”;b:1;s:13:”update_themes”;b:1;s:14:”install_themes”;b:1;s:11:”update_core”;b:1;s:10:”list_users”;b:1;s:12:”remove_users”;b:1;s:13:”promote_users”;b:1;s:18:”edit_theme_options”;b:1;s:13:”delete_themes”;b:1;s:6:”export”;b:1;}}s:6:”editor”;a:2:{s:4:”name”;s:6:”Editor”;s:12:”capabilities”;a:34:{s:17:”moderate_comments”;b:1;s:17:”manage_categories”;b:1;s:12:”manage_links”;b:1;s:12:”upload_files”;b:1;s:15:”unfiltered_html”;b:1;s:10:”edit_posts”;b:1;s:17:”edit_others_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:10:”edit_pages”;b:1;s:4:”read”;b:1;s:7:”level_7″;b:1;s:7:”level_6″;b:1;s:7:”level_5″;b:1;s:7:”level_4″;b:1;s:7:”level_3″;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:17:”edit_others_pages”;b:1;s:20:”edit_published_pages”;b:1;s:13:”publish_pages”;b:1;s:12:”delete_pages”;b:1;s:19:”delete_others_pages”;b:1;s:22:”delete_published_pages”;b:1;s:12:”delete_posts”;b:1;s:19:”delete_others_posts”;b:1;s:22:”delete_published_posts”;b:1;s:20:”delete_private_posts”;b:1;s:18:”edit_private_posts”;b:1;s:18:”read_private_posts”;b:1;s:20:”delete_private_pages”;b:1;s:18:”edit_private_pages”;b:1;s:18:”read_private_pages”;b:1;}}s:6:”author”;a:2:{s:4:”name”;s:6:”Author”;s:12:”capabilities”;a:10:{s:12:”upload_files”;b:1;s:10:”edit_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:4:”read”;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:12:”delete_posts”;b:1;s:22:”delete_published_posts”;b:1;}}s:11:”contributor”;a:2:{s:4:”name”;s:11:”Contributor”;s:12:”capabilities”;a:5:{s:10:”edit_posts”;b:1;s:4:”read”;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:12:”delete_posts”;b:1;}}s:10:”subscriber”;a:2:{s:4:”name”;s:10:”Subscriber”;s:12:”capabilities”;a:2:{s:4:”read”;b:1;s:7:”level_0″;b:1;}}}


Feel free to contact me if you are unsure about this part as it requires you to access your database at server side. I’ll be more than happy to guide you through the entire process.

Now, we have another problem after we managed to login. We realised all our WooCommerce database were gone! Pressed the panic button again, and back to troubleshooting mode.

After tinkering a little around the database, I managed to find the solution.

I realised that option names in the wp_options table for WooCommerce are not consistent. Some used wp_ as prefix while some used vbx_ as prefix. As our database uses vbx_ as our prefix, I changed all wp_ to vbx_, and our WooCommerce database is back. Phew!

Reflection: Why did this happen?

I believe this database mess happened after we migrated the website from Bluehost to Siteground.

I’m glad the website is running well now. 🙂

If you are in a similar situation and have some problems troubleshooting, or are unsure about how to access or edit your database, feel free to contact me.

Author

Leave a Reply

Your email address will not be published.

More To Explore

ZapConnect 2021

Thursday October 21, 2021 9:00am – 1:30pm PT Activate the unlimited potential of easy automation—whether you’re a first-time user or a seasoned pro. Join us

TWILIO SIGNAL Customer & Developer Conference

APAC – OCTOBER 21-22, 2021 Explore the intersection of technology, innovation, and communications. This year we’ll bring together 50,000 developers, product leaders, and visionaries to

The Billion Dollar Singles Day Virtual Summit

Thu, Oct 21, 2021 · 10:00 AM Singapore (GMT 8:00)  ASIA’S PREMIUM RETAIL CONFERENCE FOR RETAIL LEADERS. NOW VIRTUAL. The Billion Dollar Singles Day Virtual Summit

×

Hello!

Click one of our representatives below to chat on WhatsApp or send us an email to [email protected]

× How can I help you?