Password Protect WordPress wp-admin Folder

Change WordPress Security Key
August 31, 2017
Petya-like infection attempts still active in Australia
Petya-like infection attempts still active in Australia
September 1, 2017

It’s important to understand how password protection on a folder works. When you choose to password protect a directory in cPanel, cPanel creates a rule in your .htaccess file. This rule specifies that the folder is protected and the visitor will need to provide the proper username and password to log in and view the files.

Steps to Password Protect a Directory

  1. Log into cPanel
  2. Go to the Files section and click on the Directory Privacy icon
  3. Select the wp-admin folder then you will see the Set Permissions screen appear. Here you can provide a name for the folder you’re trying to protect.
  4. Next, click on the checkbox labeled Password protect the directory. Makes sure you have a name for the folder you are going to protect.
  5. Click on Save in order to save the name you have entered for the directory and option to password protect the directory.
  6. Create a user to access the protected directory
  7. Click Save in order to save the user that you have edited.

After Protect the wp-admin Folder

After activate the password for the wp-admin folder we need to add this code to the .htacess inside the wp-admin folder (not the .htacess in the root)

ErrorDocument 401 "Denied"
ErrorDocument 403 "Denied"
# Exclude the files ajax, upload and WP CRON scripts from authentication

Order allow,deny
Allow from all
Satisfy any

Leave a Reply

Your email address will not be published. Required fields are marked *

fifteen − 10 =

Get Your Hosting Today