I want to Block access to Wp-Admin and Wp-login.php Pages from Non-Admins.
I know that UsersWP can do this in a beautiful way.
The thing is that I’m not using UsersWP on my website.
The website uses WooCommerce Login and Register, and WooCommerce Login and Register doesn’t have this redirection in-built as is available in UsersWP.
I know that UsersWP has this WP-Admin and WP-login.php Page redirect because I use UsersWP on some of my websites.
For this redirect, I don’t want to use any plugin for this.
Is there any PHP code snippet in which, even if people deliberately type “mydomain.com/wp-admin” or they deliberately type “mydomain.com/wp-login.php” , it will still redirect them to the Login or Register Page I’ve created, and will prevent them from ever seeing the Wp- Admin Page or Wp-login.php Page?
Any Code Snippet like that?
Regards.
