When I try to log in to my WordPress website through /wp-admin, or /wp-login after entering the correct login and password details, it will redirect to the homepage rather than to the dashboard. I have tried the following:
- Disable all plugins.
- Changed theme from generatepress to default wp theme.
- restore .htaccess file to basic settings.
- repaired database from wp toolkit from c panel.
- Delete browser cache (Google Chrome)
- Checked (go through) the wp-config file code to see any additional code.
I have tried all possibilities one by one and again and again with no result.
Here’s an example of what it might look like:
Note: You have to put this code into your functions.php