Generally Block access to Wp-Admin and Wp-login.php from Non-Admins

[ad_1]

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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer