Block the Wordpress Login Page and how it works?

As a matter of security, I would like to block WordPress login page i.e., wp-login.php and wp-admin page from other users’ access.
How can I and what are the consequences in the case when I can’t login?

In your root directory, add the following to your .htaccess file. Replacing “127.0.0.1” with your home IP address

<Files "wp-login.php">
  order deny,allow
  deny from all
  allow from 127.0.0.1
</Files>

In the wp-admin directory, create a new .htacess file and add the following. Again, replacing “127.0.0.1” with your home IP address

order deny,allow
deny from all
allow from 127.0.0.1

I’d suggest you to take a look at a post from below which could help you with that while using Cloudflare:

Where? Into the WordPress admin or Cloudflare dashboard?
If it’s about WP admin, then hopefully you have access to the CF dash so you can tweak this and modify as needed.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.