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:
- Check your .htaccess file for an issue
- Check file and directory permission
- 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 the terminal.
Check File and Directory Permissions
After checking your .htaccess file for errors, next check permissions on files or directories. Incorrect permission settings on the public_html folder could also cause 403 Forbidden message. To fix files and directories permission, you must connect to your server using SSH using an FTP client or file manager in cPanel.
After connecting via SSH, run these 2 commands under public_html or the 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, select “permission manager,” and set permission.
Directory permission should be set to 744 or 755; similarly, file permission should be set to 640 or 644.
After applying these changes, the 403 Forbidden messages should no longer appear.
Plugin, theme, or cache conflict
To know if 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 persists after the deactivation of plugins, this may be a problem with the theme. You should download the latest version or temporarily switch to the WordPress default theme.
If the 403 Error persists even when the plugins are deactivated and the theme is switched, you may try to clear the cache and cookies on your browser.