There are quite a few reasons you may experience this error in WordPress, so try to remember what was your last action was.
- Did you install or delete a plugin?
- Did you activate or deactivate a plugin?
- Did you upload, activate or deactivate a new theme?
- Did you make any changes to your web hosting?
- Did you update anything through FTP?
- Did you update your PHP version?
try enabling debug mode. To do this open the wp-config.php file from WordPress root folder in a text editor. Find the following lines
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
define( 'SCRIPT_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
Change the false values to true and save. Now when you refresh your site, you may see other errors that may give you a better understanding of where the error is coming from.
and You should deactivate your current theme temporarily and instead activate a default WordPress theme, like Twenty Nineteen or Twenty Twenty.
and If it’s not the theme, it might be a plugin issue. You can either do exactly the same as above for separate plugins to disable individual plugins or disable all plugins altogether, which is what I recommend.
To disable all plugins all once, add something to the end of the folder’s name (like changing plugins to plugins-disabled).
Again refresh your site. If you are still seeing the same error message, then you know it is not a plugin conflict.
If the error message is no longer showing and you’re able to see or access your site again, you know that one of your plugins is causing the issue. This is where you’ll need to go through and reactivate them one-by-one to find the source. Remember to change back the folder name once you’re done.