• Hi, I am facing an issue with my wordpress admin dashboard. Whenever i try to login i get the error “Sorry, you are not allowed to access this page.” However when i get back to my home page i can see the admin panel on the top. I am the administrator of the site and i can change themes, edit pages etc, add new users without any issue.

    I have tried changing to a default theme, disabling all the plugins and whatever the steps mentioned in wordpress support forums and blogs, but still the issue is there. I have contacted my hosting provider and they haven’t provided me with a solution.
    Thanks,
    Pasan

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @pasan02 ,

    There are several troubleshooting steps you can take to try and resolve this issue:

    1). Check for .htaccess Issues

    Sometimes, issues with the .htaccess file can cause this problem. Rename the .htaccess file in the root of your WordPress installation and see if you can access the dashboard. If this resolves the issue, you can regenerate the .htaccess file by saving the permalink settings in the WordPress dashboard.

    2). Check wp-config.php for ADMIN_USERNAME

    Ensure that there are no hardcoded admin usernames or capabilities restrictions in your wp-config.php file.

    3). Inspect Database for User Capabilities
    Access your database via phpMyAdmin or a similar tool, and run the following query to see the capabilities of your user:

    SELECT * FROM wp_usermeta WHERE user_id = YOUR_USER_ID AND meta_key = ‘wp_capabilities’;

    Replace YOUR_USER_ID with your actual user ID.The value should look something like this: a:1:{s:13:”administrator”;b:1;}

    4). Reinstall WordPress Core Files
    You can do this from the WordPress dashboard under Dashboard > Updates and click Re-install Now.

    5). Check for Incorrect URLs in wp-config.php
    define(‘WP_HOME’,’https://overatours.com’);
    define(‘WP_SITEURL’,’https://overatours.com’);

    6). Debug Mode

    Enable debugging in WordPress by adding the following lines to your wp-config.php file:
    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true);
    define(‘WP_DEBUG_DISPLAY’, false);

    This will create a debug.log file in the wp-content directory. Check this file for any errors that could provide more insight into what might be causing the issue.

    Thread Starter pasan02

    (@pasan02)

    Thanks you @harpalsinhchauhan for the quick response. I went through all the steps that you have mentioned, yet the issue persists. My debugging log keeps giving me the same two messages.
    Here’s what it gives me,

    PHP Deprecated: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/u**********/domains/overatours.com/public_html/wp-includes/formatting.php on line 3506
    PHP Deprecated: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/u*********/domains/overatours.com/public_html/wp-includes/media.php on line 1839

    I assume this doesn’t have anything related with my issue?
    Thanks.

    Hello @pasan02 ,

    This 2 error log are not related with your code and work. On Php version upgrade they update some function. if you are use a old wordpress version and php version old this issue you are facing. Do one think update your wordpress version with latest and php version 8+ and check it.

    After this steps you can remove the log files and check on new genrated log file this error will be removed.

    Thread Starter pasan02

    (@pasan02)

    Hi @harpalsinhchauhan
    My website is running the latest wordpress version 6.5.3 and it runs on the php version 8.1.
    Would appreciate if you are able to provide some further information to resolve this “Sorry, you are not allowed…” issue.

    Thanks,
    Pasan

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sorry, you are not allowed to access this page.’ is closed to new replies.