◦ Comprehensive security
◦ 24/7 support
WordPress Guide → Errors → Sorry, you are not allowed to access this page
How to fix the “Sorry, you are not allowed to access this page” error on WordPress
Encountering the “Sorry, you are not allowed to access this page” error can be both frustrating and disruptive. This error often arises from various underlying issues within your WordPress site. Understanding the common causes and knowing how to troubleshoot them can help you regain access and ensure your site functions smoothly.
Common causes of the error
The “Sorry, you are not allowed to access this page” error can stem from several sources:
- Incorrect user role or permissions: If a user is unable to access certain areas of the site, it may be due to improperly assigned roles. Each user role in WordPress has specific capabilities, and if these are not correctly configured, users may find themselves locked out of essential functions.
- Corrupted or outdated plugins and themes: Plugins and themes that are not updated regularly can become incompatible with the latest version of WordPress. Additionally, corrupted files can cause functionality issues, leading to errors that disrupt site operations.
- Issues with the .htaccess file or file permissions: The .htaccess file controls how your server handles requests. If it becomes corrupted or misconfigured, it can lead to access errors. Similarly, incorrect file permissions can prevent WordPress from accessing necessary files, resulting in restricted site functionality.
- WordPress core update conflicts: When the core of WordPress is updated, it can sometimes lead to conflicts with existing plugins or themes. These conflicts can cause various issues, including the inability to log in or access certain features.
- Database or wp-config.php misconfigurations: The wp-config.php file contains critical settings for your WordPress site, including database connection details. If there are errors in this file or within the database itself, it can lead to significant access problems and errors on the site.
How to fix “Sorry, you are not allowed to access this page”
Below are steps to help you troubleshoot and resolve the “Sorry, you are not allowed to access this page” error on WordPress:
1. Check your user role and permissions
One of the first steps to resolve this error is to verify your user role and permissions.
- Verify your account in phpMyAdmin: Access your hosting control panel and open phpMyAdmin. Inspect your user role in the WordPress database, specifically within the ‘wp_users’ and ‘wp_usermeta’ tables. Ensure that the roles align with your intended access level to maintain website security and functionality.
- Manually reassign admin privileges: If adjustments are necessary, you can manually update the user role in the database. Alternatively, consider using a plugin like User Role Editor, which provides a user-friendly interface for role management, allowing you to grant or revoke privileges easily without directly manipulating database entries.
2. Disable plugins and themes
Disabling plugins and themes can help identify if a specific one is causing the error. Here’s how to do it:
- Deactivate all plugins via FTP: Connect to your website using an FTP client like FileZilla. Navigate to the ‘wp-content’ directory and rename the ‘plugins’ folder to ‘plugins_disabled’ to deactivate all plugins temporarily. This method is particularly useful if you’re unable to access the WordPress dashboard due to conflicts or errors caused by plugins.
- Deactivate all plugins via phpMyAdmin: Log into your hosting control panel, select your WordPress database, and locate the ‘wp_options’ table. Find the ‘active_plugins’ row and edit its value to deactivate all plugins. This approach provides a quick solution when troubleshooting issues that arise from plugin conflicts.
- Switch to a default theme: Use FTP to navigate to the ‘wp-content/themes’ directory and rename your active theme’s folder. This forces WordPress to revert to a default theme like Twenty Twenty-One or Twenty Twenty-Two, allowing you to check if the
After deactivating plugins and switching themes, test your site to see if the error is resolved. Reactivate plugins one by one to identify the culprit.
3. Reset the .htaccess file
Resetting your .htaccess file can often resolve the access error. Follow these steps:
- Locate and rename the .htaccess file via FTP: Connect to your website’s server using an FTP client. Navigate to the root directory of your WordPress installation and rename the .htaccess file to ‘.htaccess_old’. This step is crucial for troubleshooting any potential issues related to site functionality or permalinks.
- Generate a new .htaccess file: Log in to your WordPress admin panel, go to ‘Settings’ and then ‘Permalinks’. Click the ‘Save Changes’ button to create a new .htaccess file with the default settings. This action can resolve conflicts that may arise from outdated permalink structures or plugins that alter the .htaccess file.
4. Check file and folder permissions
Incorrect file and folder permissions can lead to access issues, potentially compromising the functionality of your website. To ensure optimal operation, make sure that your WordPress files are set with the appropriate permissions:
- Folders should be set to 755
- Files should be set to 644
You can adjust these settings using your FTP client or through your hosting control panel. If changing the permissions does not fix the access issues, it may be beneficial to explore other server configurations.
Additionally, check for any security plugins or server settings that might be interfering. If problems persist, consider reaching out to a professional to conduct a thorough assessment of your website’s security and performance.
5. Repair the WordPress database
Corrupted database tables can lead to various access problems. Repairing the database can often resolve the error:
- Use phpMyAdmin to check and repair tables: Log into your hosting account and navigate to phpMyAdmin. Select your WordPress database, check all tables, and choose ‘Repair table’ from the dropdown menu. Regular maintenance of your database can prevent issues from arising and help ensure optimal performance.
- Enable automatic database repair in wp-config.php: Add the line ‘define(‘WP_ALLOW_REPAIR’, true);’ to your wp-config.php file. Visit ‘http://yourdomain.com/wp-admin/maint/repair.php’ in your browser to repair and optimize the database. Remember to remove the line from wp-config.php after the repair process. Additionally, consider scheduling regular backups of your database to safeguard your data and make recovery easier if problems occur.
6. Reinstall WordPress core files
Reinstalling the WordPress core files can resolve issues caused by corrupted files or failed updates. Follow these steps:
- Download a fresh copy of WordPress: Visit the official WordPress website and download the latest version. Extract the contents of the ZIP file to your computer, ensuring all files are accessible for the next steps.
- Replace core files without affecting content: Connect to your website via FTP and navigate to the root directory. Upload the new ‘wp-admin’ and ‘wp-includes’ folders, and the individual files from the root directory, excluding the ‘wp-content’ folder and the ‘wp-config.php’ file. This process helps maintain your themes, plugins, and uploaded media while refreshing the core functionalities of your site.
Clear your browser cache and refresh your site to check if the error has been resolved.
Preventing future occurrences
Taking preventive measures can help avoid this error in the future:
- Regularly update WordPress, plugins, and themes to ensure that your website benefits from the latest features and security patches. This practice helps protect your site from vulnerabilities and enhances overall performance, providing a smoother experience for your users.
- Use reliable plugins and themes from trusted sources to minimize the risk of compatibility issues and security flaws. Opting for well-reviewed and frequently updated options ensures that you have access to quality support and updates that align with the latest web standards.
- Maintain regular backups of your site and database to safeguard your content and configurations. Having a reliable backup strategy allows you to restore your site quickly in the event of data loss, hacking, or technical issues, ensuring minimal downtime and a secure recovery process.
- Limit user role permissions and practice security best practices to protect your website from unauthorized access. By assigning appropriate roles and restricting capabilities, you can mitigate risks associated with user errors or malicious actions, contributing to a more secure environment for your site.
Improve your WordPress security with better hosting
Ensuring your WordPress site is secure can prevent many common issues. If you encounter persistent issues or need further support, don’t hesitate to seek professional assistance to ensure your site operates smoothly and securely.
Ready to upgrade your WordPress experience? Professional hosting improves speeds, security, and reliability for a website and a brand that people find engaging and trustworthy. Liquid Web’s WordPress hosting options configure business-class servers and support plans specifically for WordPress websites.
Don’t want to deal with server management and maintenance? Our fully managed hosting for WordPress is the best in the industry. Our team are not only server IT experts, but WordPress hosting experts as well. Your server couldn’t be in better hands.
Click through below to explore all of our hosting for WordPress options, or chat with a WordPress expert right now to get answers and advice.
Additional resources
Diagnosing WordPress errors on your site →
Even more common errors, how to troubleshoot them, and how to solve them
WordPress troubleshooting: A beginner’s guide →
Discover essential troubleshooting steps to fix common WordPress errors and keep your site running smoothly.
What is managed WordPress hosting? →
What it means, what it includes, and how to decide if it’s right for you