403-forbidden-error

WordPress 403 errors are the most frustrating thing that can happen to any website. This post will detail how to fix 403 errors in WordPress by following these simple steps:

  1. Check your .htaccess file for an issue
  2. Check file and directory permission
  3. Plugin, theme, or cache conflict

Check your .htaccess

The first step you should take when fixing 403 errors in WordPress is to check your .htaccess file, which can be found at /public_html/.htaccess or under the main/root directory of the WordPress installation.

If the 403 error message “403 Forbidden” appears after you have made changes to your website, then this means that the 403 error is coming from a .htaccess file.

If you are an OpenLitespeed user, then you need to restart your LiteSpeed server using the below command in terminal

Check File and Directory Permissions

After checking your .htaccess file for errors, next check permissions on files or directories. 403 Forbidden message could also be caused by incorrect permission settings on the public_html folder. To fix files and directories permission, you need to connect to your server using SSH using an FTP client or file manager in cPanel.

After connected via SSH, run these 2 commands under public_html or main directory of the WordPress installation:

If SSH is not available, try FTP or file manager in cPanel. Right-click on the directory and file name and select “permission manager,” and set permission.

Directory permission should be set to 744 or 755, and similarly, file permission should be set 640 or 644.

After you have applied these changes, the 403 Forbidden message should not appear anymore.

Plugin, theme, or cache conflict

In order to know the 403 error message is coming from a specific plugin, you can deactivate it temporarily and see if the 403 Forbidden error still appears.

If the 403 error still persists after the deactivation of plugins, then this may be a problem with the theme. You should download the latest version or switch to the WordPress default theme temporarily.

If the 403 Error still persists even when the plugins are deactivated and the theme switched, you may try to clear the cache and cookies on your browser.