The Best Method to Password Protect Your WordPress admin (wp-admin)

Advertisements

The Best Method to Password Protect Your WordPress admin wp admin The Best Method to Password Protect Your WordPress admin (wp admin)

As you examine the title of the post, you’re possibly thinking is not the wp-admin directory currently password shielded. You’re necessary to sign in properly. Nicely that is real, but to put an extra level of protection popular websites usually put an additional layer of authorization. Very few days ago, we started out finding some questionable exercise on WikiKnowledgee, so our web host HostGator recommended us to password secure our WordPress admin directory. Surprisingly favorite websites like Mashable do the exact same. In this post, we’ll demonstrate you a detail by detail tutorial on how to password secure your WordPress administrator (wp-admin) directory.

To maintain things straightforward and very simple, we’ll only handle cPanel web hosting service providers here just mainly because cPanel has an uncomplicated enough program to include password secured directories.

Logon to your cPanel. Scroll down until finally you see the Security Tab. Just click on the “Password Protect Directories” image.

security tab in cpanel The Best Method to Password Protect Your WordPress admin  The Best Method to Password Protect Your WordPress admin (wp admin)

Once you select that, a box pop-up will turn up questioning for location of the directory. Simply select website root. When you’re there, browse through the directory in which your WordPress is located. Then click on the /wp-admin/ folder. You’ll see a display screen like this:

Just check out the box to password shield the directory. Then generate a user. Now if you test to gain access to your wp-admin directory, you should really see an authorization demanded box similar to this:

cpanel Security Settings Folder Protect The Best Method to Password Protect Your WordPress admin (wp admin)

the best method to secure wordpress admin cpanel Security Settings Folder Protect The Best Method to Password Protect Your WordPress admin (wp admin)

Initially generate a .htpasswds file. You will do so very easily by making use of this generator.This file must be uploaded outside your /public_html/ directory. A very good path can be:

AuthName “Admins Only”
AuthUserFile /home/yourdirectory/.htpasswds/public_html/wp-admin/passwd
AuthGroupFile /dev/null
AuthType basic
require user putyourusernamehere

home/user/.htpasswds/public_html/wp-admin/passwd/

 

After this, make a .htaccess file and upload it in /wp-admin/ directory. Then put the following unique codes in there:

You will have to upgrade your login name in there. Also do not ignore to upgrade the AuthUserFile directory.

There is  a 404 Error or a Too many redirects problem

Well this will occur based on how your hosting server is set up. To resolve this problem, open your primary WordPress .htaccess file and put the following code there just before the WordPress procedures get started.

ErrorDocument 401 default

Perfectly there you have done it. Now you may have two times authorization for your WordPress administration area. This is certainly a good option to restricting wp-admin access by Ip address.

The following is how to correct the Admin Ajax Problem

In case your WordPress admin directory is password protected, then it will eventually break up the Ajax performance in the front-end. In our situation, we do not have any plug-ins which is working with ajax in the front-end. But if you undertake, then the following is how you resolve that problem.

Open up the .htaccess file situated in your /wp-admin/ folder .

Inside the wp-admin .htaccess file, insert the following code:

<Files admin-ajax.php>
    Order allow,deny
    Allow from all
    Satisfy any
</Files>

Advertisements

Leave a Reply