Web Hosting in Pakistan

“Sorry, you are not allowed to access this page error”? [SOLVED]

Getting sorry, you are not allowed to access this page error? Well, you can’t access your website when the screen shows this error. So, does that mean your website is doomed? Nope, you don’t have to worry, as we’ll share five different ways to resolve this error. All you have to do is focus on the instructions.

First things first:

If you see this error popping up on your WP Panel, you should start the resolution process by restoring the backup. But what if you don’t have one? Then the following five solutions are definitely for you.

At this point, it is still recommended that you should create a backup of your website in whatever condition it is, so you can revert to this point if something goes wrong further.

Enable WP Debug:

The first solution is to enable WP Debug. It will find any PHP errors in the website that could be restricting its proper functioning. Here’s what you need to do:

  • Go to C-Panel. Find the File Manager and go to public_html present in this folder.
  • By selecting the domain you want to fix, you’ll have to go to wp-config.php and enable the editing mode.
  • Don’t worry; you don’t have to be a coder for editing this file. Press Ctrl+ F and write wp_debug. Once you reach this point, change the “false” command to “true” and save the changes.

If the errors would be caused by PHP issues, you’ll be able to find them using this method and amend accordingly.

Change the prefix in the config file:

By using this method, we are assuming that WordPress isn’t recognizing the database because of some reason. So, we’ll try to fix it.

  • If you have applied the above method, you are already in the wp-config.php file.
  • Scroll down to find the table_prefix. You might use the search feature to look for it, as well.
  • Once you are there, remove the file name between the comas. You can change it to any name you want and then save the changes.
  • Now come back to your website and reload. You’ll be asked to reinstall the website. But you don’t have to do it.
  • Go back to the same setting and change the name back to “wp_” as it was previously.
  • This might solve the “sorry, you are not allowed to access this page error”.

Disable themes and plugins:

Sometimes, a problem in the theme coding or the compatibility issues with the plugin could be showing you the access error on the screen.

To resolve it, disable themes and plugins. As your front end is not working, so you’ll have to go to the backend for this purpose.

  • After opening the File Manager from the c-panel, look for your domain.
  • In the domain folder, you’ll find wp_content, go to the themes folder and rename it to anything other than the original name.
  • Reload your website to check if it worked. If it didn’t, try disabling the plugins.
  • From the same folder, open plugins and change the names of the ones that you think could be causing the error. (Tip: usually, the ones you have recently installed could be the culprit.)

Create new .htaccess file:

  • Go to your domain's folder using the File Manager.
  • You’ll see the .htaccess file in it.
  • Create a backup of this file and delete it.
  • Now create a new .htaccess file in this folder by creating a new file and pasting the standard code in it (you can find it online easily).

Change database to default state:

  • Open C Panel
  • Find PHPMyAdmin
  • Open the database that you are web hosting your domain with. Select it from the left panel.
  • Opening it will show the sub-folders. Find the wp_options and click it.
  • Now using the search feature, find the “template”.
  • You’ll get a single row back in the search result.
  • Click edit and change the theme (whatever you are using) to a default one like twentytwentyone. Click Go.
  • Go to search result again. 
  • Use “stylesheet” in the name field. 
  • You'll see the search results. Now, click on Edit.
  • Add the same theme name here as well.
  • Go to the search again, find active plugins, and click on edit.
  • Remove all the text that exists between the brackets. Click on Go.
  • Now load your website and check if it works now.

Summing up:

By following these procedures, you are trying to eliminate all the possible causes that could be creating the access issue. We are sure that a least one of these solutions will bring your website back.

Also Read: How to create a TeamSpeak Server