WordPress.org

Ready to get started?Download WordPress

Forums

How to protect wp-login and wp-admin (2 posts)

  1. MSNexus
    Member
    Posted 4 years ago #

    Hi WP community,
    I want to "hide" or protect my wp-login.php file and wp-admin folder.
    So I want to create something like this:
    If someone come to "my-website_url/wp-login.php" and "my-website_url/wp-admin", then that person will be redirect to the main/home page of my website.
    How can I do that?
    Thanks so much!

    EDIT: I Know how to redirect wp-login.php to another url, but I donĀ“t know how to hide wp-login.php,

  2. Zemalf
    Member
    Posted 3 years ago #

    At least you can limit the access by IP. Only useful if your (or anyone else's who needs to access) have static IP which doesn't change too often. And not good if too many people need to login...

    For wp-login.php, add this to the WP install dir .htaccess (where wp-login is):

    <Files wp-login.php>
    Order Deny,Allow
    Deny from All
    Allow from x.x.x.x
    </Files>

    To wp-admin folder .htaccess add this:

    AuthUserFile /dev/null
    AuthGroupFile /dev/null
    AuthName "Example Access Control"
    AuthType Basic
    <Limit GET>
    Order Deny,Allow
    Deny from all
    Allow from x.x.x.x
    </Limit>

Topic Closed

This topic has been closed to new replies.

About this Topic