Bug Summary
When importing a site via ZIP in Local WP, if the database table prefix in the imported database contains uppercase letters (e.g. Bwcvqcqk), Local WP generates the wp-config.php with the prefix in lowercase (e.g. bwcvqcqk). This mismatch causes WordPress to be unable to read user roles from wp_usermeta, resulting in the error “Sorry, you are not allowed to access this page” when trying to access /wp-admin, even though the user exists and the capabilities record is present in the database.
Steps to reproduce
- Export a WordPress site as a ZIP file where the database table prefix contains uppercase letters.
- Import the ZIP into Local WP using the drag-and-drop or import site feature.
- Start the site and navigate to https://yoursite.local/wp-admin.
- Log in with valid credentials.
- Observe the error: “Sorry, you are not allowed to access this page.”
- Check wp_usermeta (or the prefixed equivalent): the meta_key for capabilities is stored with the original mixed-case prefix (e.g.
Bwcvqcqkcapabilities), but WordPress looks for it using the lowercase prefix defined in wp-config.php (e.g.bwcvqcqkcapabilities), so the role is never found.
Environment Info
- Operating System: Windows
- Web server: nginx (Local WP managed)
- PHP, MySQL: Local WP default versions for the imported site
- Local WP version:Version 10.0.0+6907
Supporting info
The fix is manual: open wp-config.php and ensure $table_prefix matches the actual table prefix in the database exactly, including case. Alternatively, update the meta_key values in the usermeta table to match the lowercase prefix Local WP writes to wp-config.php.