Prevent admin account from logging-in via WooCommerce Login Page

346 Views Asked by At

I am trying to harden the best I can admin access to a WordPress site with WooCommerce.

So far I managed to do the following:

  • whitelist the admin access from a specific IP in .htaccess with:

    <Files wp-login.php>
      order deny,allow
      deny from all
      allow from 123.123.123.123
    </Files>
    
  • allow WooCommerce customers to login via WooCommerce login page (example.com/my-account)

I have two problems however:

  1. Admin is still able to login from WooCommerce login page example.com/my-account and I would like to avoid that (as it makes the above .htacess rule useless)
  2. When customers are trying to logout, they get 403 Forbidden (I guess it's due to the above .htaccess rule)

So I was wondering has anybody managed to accomplish what I am trying to achieve?

0

There are 0 best solutions below