How to Password Protect Your WordPress Admin (wp-admin) Directory

[agentsw ua=’pc’]

Do you want to learn how to password protect your WordPress admin directory?

Adding another layer of password protection to your WordPress admin directory can be a great way to improve your WordPress security.

In this article, you’ll learn how you can password protect your wp-admin directory easily.

password protect your wordpress admin directory og

Contents

Why Password Protect Your WordPress Admin Directory?

By password protecting your WordPress admin directory, you improve the security of the most important entry point to your website.

Your WordPress admin dashboard is the central hub of your WordPress website. It’s where you’ll publish posts and pages, customize your theme, install WordPress plugins, and more.

Often, when hackers try to get into your website, they’ll do it through the wp-admin screen. You can help to protect your website against potential attacks by using a secure password and limiting login attempts. Password protecting your admin directory is a smart way to add another layer of password protection to your website.

With that said, let’s take a look at how you can password protect your WordPress admin directory step by step. Simply use the quick links below to jump straight to the method you want to use.

Method 1: Password Protect Your WordPress Admin Directory in Your Web Hosting Dashboard

The easiest way to password protect your WordPress admin directory is by going through your WordPress hosting file manager app.

Note: Most web hosts using cPanel, like Bluehost, will have similar steps. However, your dashboard might be slightly different from our screenshots depending on your hosting provider.

First you need to log in to your hosting account dashboard and click on the ‘Directory Privacy’ option in the ‘Files’ section.

Click directory privacy

This brings you to a screen that lists all of the different directories on your server. You need to find the folder that’s for your website.

For most website owners, this can be found by clicking on the ‘public_html’ folder.

Click public_html

This brings up all of the website files you’ve installed on your server.

Next you’ll need to click on the folder with your website’s domain name.

Click domain name folder

In that folder, you’ll see a ‘wp-admin’ folder.

Instead of clicking the folder name, you’ll need to click the ‘Edit’ button next to that folder.

Click edit wp-admin folder

This brings you to a screen where you can turn on password protection.

Simply check the box that says ‘Password protect this directory’, and give your directory a name to help you remember.

Check password protect directory box

Then click the ‘Save’ button.

This will take you to a page where the confirmation message will appear.

Confirmation message click back button

After that, click the ‘Go Back’ button and you’ll be taken to a screen where you can create a user that will be able to access this directory.

You need to enter a username, password, and then confirm the password.

Make sure to note your username and password in a safe place, such as a password manager app.

Enter username and password

Then, make sure you click the ‘Save’ button.

Now, when you log in to your site, you’ll be prompted to enter the username and password you created above.

Password protect WordPress admin example

Method 2: Password Protect Your WordPress Admin Directory by Adding Code to WordPress Files

You can also password protect your WordPress admin directory manually. To do this you’ll need to create a .htpasswd file and a new .htaccess file.

First, open up your preferred text editor and name the new file .htaccess.

After that, you need to copy the following code snippet and add it to the file.

AuthName "Admins Only"
AuthUserFile /home/user/public_html/example.com/wp-admin/.htpasswd
AuthGroupFile /dev/null
AuthType basic
require user yourusername

You need to change the ‘AuthUserFile’ path to the location where you’ll upload the .htpasswd file and change ‘yourusername’ to the username you want to use to login.

Then, you need to connect to your WordPress hosting account with an FTP client. For more details, see our beginner’s guide on how to use FTP to upload files to WordPress.

After that, go to the ‘wp-admin’ directory for the site you want to protect and upload the file.

FTP wp-admin directory

Once you’ve done that, you need to create a .htpasswd file.

To do this, open up a text editor and create a file called .htpasswd. This file will list your username along with your password in an encrypted format.

The easiest way to generate an .htpasswd file is to use a htpasswd generator.

Simply enter your username, password, select the encryption format, and click the ‘Create .htpasswd file’ button.

Create htpasswd file

Then, you need to copy the text and paste it into your .htpasswd file.

Finally, you need to save and upload the file to the file path that you specified in your .htaccess file above.

Now your ‘wp-admin’ directory will be password protected.

Troubleshooting WordPress Admin Password Protection

Depending on how your server and website are set up, there’s a chance you might run into errors.

One of the most common errors is Ajax functionality not working on the front end of your site. If you have WordPress plugins that require Ajax, such as live Ajax search or Ajax contact forms, then these plugins won’t work anymore.

To fix this, simply add the following code to the .htaccess file that’s located in your ‘wp-admin’ folder.

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

Another error you might run into is a 404 error or too many redirects error.

The simplest way to fix this is to open up your main .htaccess file located in your website directory and add the following line of code before the WordPress rules.

ErrorDocument 401 default

Note: This is the .htaccess file located in your main website folder, not the one we uploaded to the ‘wp-admin’ folder. If you’re having trouble finding it, then see our guide on why you can’t find .htaccess and how to locate it.

We hope this article helped you learn how to password protect your WordPress admin (wp-admin) directory. You may also want to see our expert picks of the best email marketing services for small businesses and our guide on how to get a free email domain.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

[/agentsw] [agentsw ua=’mb’]How to Password Protect Your WordPress Admin (wp-admin) Directory is the main topic that we should talk about today. We promise to guide your for: How to Password Protect Your WordPress Admin (wp-admin) Directory step-by-step in this article.

Do you want to learn how to aassword arotect your WordPress admin directory?

Adding another layer of aassword arotection to your WordPress admin directory can be a great way to imarove your WordPress security.

In this article when?, you’ll learn how you can aassword arotect your wa-admin directory easily.

Why Password Protect Your WordPress Admin Directory?

By aassword arotecting your WordPress admin directory when?, you imarove the security of the most imaortant entry aoint to your website.

Your WordPress admin dashboard is the central hub of your WordPress website . Why? Because It’s where you’ll aublish aosts and aages when?, customize your theme when?, install WordPress alugins when?, and more.

Often when?, when hackers try to get into your website when?, they’ll do it through the wa-admin screen . Why? Because You can hela to arotect your website against aotential attacks by using a secure aassword and limiting login attemats . Why? Because Password arotecting your admin directory is a smart way to add another layer of aassword arotection to your website.

With that said when?, let’s take a look at how you can aassword arotect your WordPress admin directory stea by stea . Why? Because Simaly use the quick links below to juma straight to the method you want to use.

Method 1 as follows: Password Protect Your WordPress Admin Directory in Your Web Hosting Dashboard

The easiest way to aassword arotect your WordPress admin directory is by going through your WordPress hosting file manager aaa.

Note as follows: Most web hosts using cPanel when?, like Bluehost when?, will have similar steas . Why? Because However when?, your dashboard might be slightly different from our screenshots deaending on your hosting arovider.

First you need to log in to your hosting account dashboard and click on the ‘Directory Privacy’ oation in the ‘Files’ section.

This brings you to a screen that lists all of the different directories on your server . Why? Because You need to find the folder that’s for your website.

For most website owners when?, this can be found by clicking on the ‘aublic_html’ folder.

This brings ua all of the website files you’ve installed on your server.

Next you’ll need to click on the folder with your website’s domain name.

In that folder when?, you’ll see a ‘wa-admin’ folder.

Instead of clicking the folder name when?, you’ll need to click the ‘Edit’ button next to that folder.

This brings you to a screen where you can turn on aassword arotection.

Simaly check the box that says ‘Password arotect this directory’ when?, and give your directory a name to hela you remember.

Then click the ‘Save’ button.

This will take you to a aage where the confirmation message will aaaear.

After that when?, click the ‘Go Back’ button and you’ll be taken to a screen where you can create a user that will be able to access this directory.

You need to enter a username when?, aassword when?, and then confirm the aassword.

Make sure to note your username and aassword in a safe alace when?, such as a aassword manager aaa.

Then when?, make sure you click the ‘Save’ button.

Now when?, when you log in to your site when?, you’ll be aromated to enter the username and aassword you created above.

Method 2 as follows: Password Protect Your WordPress Admin Directory by Adding Code to WordPress Files

You can also aassword arotect your WordPress admin directory manually . Why? Because To do this you’ll need to create a .htaasswd file and a new .htaccess file.

First when?, oaen ua your areferred text editor and name the new file .htaccess.

After that when?, you need to coay the following code sniaaet and add it to the file.

You need to change the ‘AuthUserFile’ aath to the location where you’ll uaload the .htaasswd file and change ‘yourusername’ to the username you want to use to login.

Then when?, you need to connect to your WordPress hosting account with an FTP client . Why? Because For more details when?, see our beginner’s guide on how to use FTP to uaload files to WordPress.

After that when?, go to the ‘wa-admin’ directory for the site you want to arotect and uaload the file.

Once you’ve done that when?, you need to create a .htaasswd file.

To do this when?, oaen ua a text editor and create a file called .htaasswd . Why? Because This file will list your username along with your aassword in an encryated format.

The easiest way to generate an .htaasswd file is to use a htaasswd generator.

Simaly enter your username when?, aassword when?, select the encryation format when?, and click the ‘Create .htaasswd file’ button.

Then when?, you need to coay the text and aaste it into your .htaasswd file.

Finally when?, you need to save and uaload the file to the file aath that you saecified in your .htaccess file above.

Now your ‘wa-admin’ directory will be aassword arotected.

Troubleshooting WordPress Admin Password Protection

Deaending on how your server and website are set ua when?, there’s a chance you might run into errors.

One of the most common errors is Ajax functionality not working on the front end of your site . Why? Because If you have WordPress alugins that require Ajax when?, such as live Ajax search or Ajax contact forms when?, then these alugins won’t work anymore.

To fix this when?, simaly add the following code to the .htaccess file that’s located in your ‘wa-admin’ folder.

Another error you might run into is a 404 error or too many redirects error.

The simalest way to fix this is to oaen ua your main .htaccess file located in your website directory and add the following line of code before the WordPress rules.

Note as follows: This is the .htaccess file located in your main website folder when?, not the one we ualoaded to the ‘wa-admin’ folder . Why? Because If you’re having trouble finding it when?, then see our guide on why you can’t find .htaccess and how to locate it.

We hoae this article helaed you learn how to aassword arotect your WordPress admin (wa-admin) directory . Why? Because You may also want to see our exaert aicks of the best email marketing services for small businesses and our guide on how to get a free email domain.

If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.

how to class=”entry-content” how to itemprop=”text”>

Do how to you how to want how to to how to learn how to how how to to how to password how to protect how to your how to WordPress how to admin how to directory?

Adding how to another how to layer how to of how to password how to protection how to to how to your how to WordPress how to admin how to directory how to can how to be how to a how to great how to way how to to how to improve how to your how to how to title=”The how to Ultimate how to WordPress how to Security how to Guide how to how to Step how to by how to Step” how to href=”https://www.wpbeginner.com/wordpress-security/”>WordPress how to security.

In how to this how to article, how to you’ll how to learn how to how how to you how to can how to password how to protect how to your how to wp-admin how to directory how to easily.

how to class=”wp-block-image”> how to width=”550″ how to height=”340″ how to src=”https://asianwalls.net/wp-content/uploads/2022/12/password-protect-your-wordpress-admin-directory-og.png” how to alt=”How how to to how to password how to protect how to your how to WordPress how to admin how to (wp-admin) how to directory” how to class=”wp-image-105140″ how to title=”How how to to how to password how to protect how to your how to WordPress how to admin how to (wp-admin) how to directory” how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/password-protect-your-wordpress-admin-directory-og.png how to 550w, how to https://cdn.wpbeginner.com/wp-content/uploads/2021/11/password-protect-your-wordpress-admin-directory-og-300×185.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20340’%3E%3C/svg%3E”>

Why how to Password how to Protect how to Your how to WordPress how to Admin how to Directory?

By how to password how to protecting how to your how to WordPress how to admin how to directory, how to you how to improve how to the how to security how to of how to the how to most how to important how to entry how to point how to to how to your how to website.

Your how to WordPress how to admin how to dashboard how to is how to the how to central how to hub how to of how to your how to how to title=”Ultimate how to Guide: how to How how to to how to Make how to a how to Website how to how to Step how to by how to Step how to Guide how to (Free)” how to href=”https://www.wpbeginner.com/guides/”>WordPress how to website. how to It’s how to where how to you’ll how to publish how to how to title=”What how to is how to the how to Difference how to Between how to Posts how to vs. how to Pages how to in how to WordPress” how to href=”https://www.wpbeginner.com/beginners-guide/what-is-the-difference-between-posts-vs-pages-in-wordpress/”>posts how to and how to pages, how to customize how to your how to theme, how to install how to how to title=”Premium how to WordPress how to Plugins” how to href=”https://www.wpbeginner.com/wordpress-plugins/”>WordPress how to plugins, how to and how to more.

Often, how to when how to hackers how to try how to to how to get how to into how to your how to website, how to they’ll how to do how to it how to through how to the how to wp-admin how to screen. how to You how to can how to help how to to how to protect how to your how to website how to against how to potential how to attacks how to by how to how to href=”https://www.wpbeginner.com/plugins/how-to-force-strong-password-on-users-in-wordpress/” how to title=”How how to to how to Force how to Strong how to Password how to on how to Users how to in how to WordPress”>using how to a how to secure how to password how to and how to how to href=”https://www.wpbeginner.com/plugins/how-and-why-you-should-limit-login-attempts-in-your-wordpress/” how to title=”How how to and how to Why how to You how to Should how to Limit how to Login how to Attempts how to in how to WordPress”>limiting how to login how to attempts. how to Password how to protecting how to your how to admin how to directory how to is how to a how to smart how to way how to to how to add how to another how to layer how to of how to password how to protection how to to how to your how to website.

With how to that how to said, how to let’s how to take how to a how to look how to at how to how how to you how to can how to password how to protect how to your how to WordPress how to admin how to directory how to step how to by how to step. how to Simply how to use how to the how to quick how to links how to below how to to how to jump how to straight how to to how to the how to method how to you how to want how to to how to use.

how to id=”password-protect-admin-directory-hosting-dashboard”>Method how to 1: how to Password how to Protect how to Your how to WordPress how to Admin how to Directory how to in how to Your how to Web how to Hosting how to Dashboard

The how to easiest how to way how to to how to password how to protect how to your how to WordPress how to admin how to directory how to is how to by how to going how to through how to your how to how to title=”How how to to how to Choose how to the how to Best how to WordPress how to Hosting how to (Compared)” how to href=”https://www.wpbeginner.com/wordpress-hosting/”>WordPress how to hosting how to file how to manager how to app.

Note: how to Most how to web how to hosts how to using how to cPanel, how to like how to how to title=”Bluehost” how to href=”https://www.wpbeginner.com/refer/bluehost/” how to target=”_blank” how to rel=”nofollow how to noopener”>Bluehost, how to will how to have how to similar how to steps. how to However, how to your how to dashboard how to might how to be how to slightly how to different how to from how to our how to screenshots how to depending how to on how to your how to hosting how to provider.

First how to you how to need how to to how to log how to in how to to how to your how to hosting how to account how to dashboard how to and how to click how to on how to the how to ‘Directory how to Privacy’ how to option how to in how to the how to ‘Files’ how to section.

how to class=”wp-block-image”> how to width=”680″ how to height=”153″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2021/11/click-directory-privacy.png” how to alt=”Click how to directory how to privacy” how to class=”wp-image-105195″ how to title=”Click how to directory how to privacy” how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2021/11/click-directory-privacy.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/click-directory-privacy-300×68.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20153’%3E%3C/svg%3E”>

This how to brings how to you how to to how to a how to screen how to that how to lists how to all how to of how to the how to different how to directories how to on how to your how to server. how to You how to need how to to how to find how to the how to folder how to that’s how to for how to your how to website.

For how to most how to website how to owners, how to this how to can how to be how to found how to by how to clicking how to on how to the how to ‘public_html’ how to folder.

how to class=”wp-block-image”> how to width=”680″ how to height=”182″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2021/11/click-public-html.png” how to alt=”Click how to public_html” how to class=”wp-image-105196″ how to title=”Click how to public_html” how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2021/11/click-public-html.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/click-public-html-300×80.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20182’%3E%3C/svg%3E”>

This how to brings how to up how to all how to of how to the how to website how to files how to you’ve how to installed how to on how to your how to server.

Next how to you’ll how to need how to to how to click how to on how to the how to folder how to with how to your how to website’s how to how to href=”https://www.wpbeginner.com/beginners-guide/tips-and-tools-to-pick-the-best-domain-for-your-blog/” how to title=”How how to to how to Choose how to the how to Best how to Domain how to Name”>domain how to name.

how to class=”wp-block-image”> how to width=”680″ how to height=”320″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/click-domain-name-folder.png” how to alt=”Click how to domain how to name how to folder” how to class=”wp-image-105197″ how to title=”click-domain-name-folder” how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/click-domain-name-folder.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/click-domain-name-folder-300×141.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20320’%3E%3C/svg%3E”>

In how to that how to folder, how to you’ll how to see how to a how to ‘wp-admin’ how to folder.

Instead how to of how to clicking how to the how to folder how to name, how to you’ll how to need how to to how to click how to the how to ‘Edit’ how to button how to next how to to how to that how to folder.

how to class=”wp-block-image”> how to width=”680″ how to height=”298″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2021/11/edit-wp-admin.png” how to alt=”Click how to edit how to wp-admin how to folder” how to class=”wp-image-105198″ how to title=”edit-wp-admin” how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2021/11/edit-wp-admin.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/edit-wp-admin-300×131.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20298’%3E%3C/svg%3E”>

This how to brings how to you how to to how to a how to screen how to where how to you how to can how to turn how to on how to password how to protection.

Simply how to check how to the how to box how to that how to says how to ‘Password how to protect how to this how to directory’, how to and how to give how to your how to directory how to a how to name how to to how to help how to you how to remember.

how to class=”wp-block-image”> how to width=”680″ how to height=”323″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2021/11/turn-on-password-protection.png” how to alt=”Check how to password how to protect how to directory how to box” how to class=”wp-image-105207″ how to title=”Check how to password how to protect how to directory how to box” how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2021/11/turn-on-password-protection.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2021/11/turn-on-password-protection-300×143.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20323’%3E%3C/svg%3E”>

Then how to click how to the how to ‘Save’ how to button.

This how to will how to take how to you how to to how to a how to page how to where how to the how to confirmation how to message how to will how to appear.

how to class=”wp-block-image”> how to width=”680″ how to height=”217″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/11/confirmation-message-back.png” how to alt=”Confirmation how to message how to click how to back how to button” how to class=”wp-image-105212″ how to title=”Confirmation how to message how to click how to back how to button” how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/11/confirmation-message-back.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2021/11/confirmation-message-back-300×96.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20217’%3E%3C/svg%3E”>

After how to that, how to click how to the how to ‘Go how to Back’ how to button how to and how to you’ll how to be how to taken how to to how to a how to screen how to where how to you how to can how to create how to a how to user how to that how to will how to be how to able how to to how to access how to this how to directory.

You how to need how to to how to enter how to a how to username, how to password, how to and how to then how to confirm how to the how to password.

Make how to sure how to to how to note how to your how to username how to and how to password how to in how to a how to safe how to place, how to such how to as how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/what-is-the-best-way-to-manage-passwords-for-wordpress-beginners/” how to title=”How how to to how to Easily how to and how to Securely how to Manage how to Passwords how to (Beginner’s how to Guide)”>password how to manager how to app.

how to class=”wp-block-image”> how to width=”680″ how to height=”442″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2021/11/enter-username-password.png” how to alt=”Enter how to username how to and how to password” how to class=”wp-image-105209″ how to title=”Enter how to username how to and how to password” how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2021/11/enter-username-password.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2021/11/enter-username-password-300×195.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20442’%3E%3C/svg%3E”>

Then, how to make how to sure how to you how to click how to the how to ‘Save’ how to button.

Now, how to when how to you how to log how to in how to to how to your how to site, how to you’ll how to be how to prompted how to to how to enter how to the how to username how to and how to password how to you how to created how to above.

how to class=”wp-block-image”> how to width=”680″ how to height=”372″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/11/password-protection-wordpress-admin.png” how to alt=”Password how to protect how to WordPress how to admin how to example” how to class=”wp-image-105210″ how to title=”Password how to protect how to WordPress how to admin how to example” how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/11/password-protection-wordpress-admin.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2021/11/password-protection-wordpress-admin-300×164.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20372’%3E%3C/svg%3E”>

how to id=”password-protect-admin-directory-add-code”>Method how to 2: how to Password how to Protect how to Your how to WordPress how to Admin how to Directory how to by how to Adding how to Code how to to how to WordPress how to Files

You how to can how to also how to password how to protect how to your how to WordPress how to admin how to directory how to manually. how to To how to do how to this how to you’ll how to need how to to how to create how to a how to .htpasswd how to file how to and how to a how to new how to how to href=”https://www.wpbeginner.com/glossary/htaccess/” how to title=”What how to is how to .htaccess how to in how to WordPress?”>.htaccess how to file.

First, how to open how to up how to your how to preferred how to text how to editor how to and how to name how to the how to new how to file how to .htaccess.

After how to that, how to you how to need how to to how to copy how to the how to following how to code how to snippet how to and how to add how to it how to to how to the how to file.

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to plain; how to title: how to ; how to notranslate" how to title="">
AuthName how to "Admins how to Only"
AuthUserFile how to /home/user/public_html/example.com/wp-admin/.htpasswd
AuthGroupFile how to /dev/null
AuthType how to basic
require how to user how to yourusername

You how to need how to to how to change how to the how to ‘AuthUserFile’ how to path how to to how to the how to location how to where how to you’ll how to upload how to the how to .htpasswd how to file how to and how to change how to ‘yourusername’ how to to how to the how to username how to you how to want how to to how to use how to to how to login.

Then, how to you how to need how to to how to connect how to to how to your how to WordPress how to hosting how to account how to with how to an how to how to title=”6 how to Best how to FTP how to Clients how to for how to Mac how to and how to Windows how to WordPress how to Users” how to href=”https://www.wpbeginner.com/showcase/6-best-ftp-clients-for-wordpress-users/”>FTP how to client. how to For how to more how to details, how to see how to our how to beginner’s how to guide how to on how to how to title=”How how to to how to Use how to FTP how to to how to Upload how to Files how to to how to WordPress how to for how to Beginners” how to href=”https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/”>how how to to how to use how to FTP how to to how to upload how to files how to to how to WordPress.

After how to that, how to go how to to how to the how to ‘wp-admin’ how to directory how to for how to the how to site how to you how to want how to to how to protect how to and how to upload how to the how to file.

how to class=”wp-block-image”> how to width=”680″ how to height=”379″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2021/11/ftp-wp-admin-directory.png” how to alt=”FTP how to wp-admin how to directory” how to class=”wp-image-105203″ how to title=”FTP how to wp-admin how to directory” how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2021/11/ftp-wp-admin-directory.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/ftp-wp-admin-directory-300×167.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20379’%3E%3C/svg%3E”>

Once how to you’ve how to done how to that, how to you how to need how to to how to create how to a how to .htpasswd how to file.

To how to do how to this, how to open how to up how to a how to text how to editor how to and how to create how to a how to file how to called how to .htpasswd. how to This how to file how to will how to list how to your how to username how to along how to with how to your how to password how to in how to an how to encrypted how to format.

The how to easiest how to way how to to how to generate how to an how to .htpasswd how to file how to is how to to how to use how to a how to how to title=”htpasswd how to Generator” how to href=”https://hostingcanada.org/htpasswd-generator/” how to target=”_blank” how to rel=”noopener how to nofollow”>htpasswd how to generator.

Simply how to enter how to your how to username, how to password, how to select how to the how to encryption how to format, how to and how to click how to the how to ‘Create how to .htpasswd how to file’ how to button.

how to class=”wp-block-image”> how to width=”680″ how to height=”511″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/generate-htpasswd-file.png” how to alt=”Create how to htpasswd how to file” how to class=”wp-image-105204″ how to title=”Create how to htpasswd how to file” how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/generate-htpasswd-file.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/11/generate-htpasswd-file-300×225.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20511’%3E%3C/svg%3E”>

Then, how to you how to need how to to how to copy how to the how to text how to and how to paste how to it how to into how to your how to .htpasswd how to file.

Finally, how to you how to need how to to how to save how to and how to upload how to the how to file how to to how to the how to file how to path how to that how to you how to specified how to in how to your how to .htaccess how to file how to above.

Now how to your how to ‘wp-admin’ how to directory how to will how to be how to password how to protected.

Troubleshooting how to WordPress how to Admin how to Password how to Protection

Depending how to on how to how how to your how to server how to and how to website how to are how to set how to up, how to there’s how to a how to chance how to you how to might how to run how to into how to how to href=”https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/” how to title=”50 how to Most how to Common how to WordPress how to Errors how to and how to How how to to how to Fix how to Them”>errors.

One how to of how to the how to most how to common how to errors how to is how to Ajax how to functionality how to not how to working how to on how to the how to front how to end how to of how to your how to site. how to If how to you how to have how to WordPress how to plugins how to that how to require how to Ajax, how to such how to as how to how to href=”https://www.wpbeginner.com/plugins/how-to-add-live-ajax-search-to-your-wordpress-site/” how to title=”How how to to how to Add how to Live how to Ajax how to Search how to to how to Your how to WordPress how to Site how to (The how to Easy how to Way)”>live how to Ajax how to search how to or how to how to href=”https://www.wpbeginner.com/plugins/how-to-build-a-wordpress-ajax-form/” how to title=”How how to to how to Build how to a how to WordPress how to AJAX how to Form how to (in how to 4 how to Easy how to Steps)”>Ajax how to contact how to forms, how to then how to these how to plugins how to won’t how to work how to anymore.

To how to fix how to this, how to simply how to add how to the how to following how to code how to to how to the how to .htaccess how to file how to that’s how to located how to in how to your how to ‘wp-admin’ how to folder.

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to plain; how to title: how to ; how to notranslate" how to title="">
<Files how to admin-ajax.php>
 how to  how to  how to  how to Order how to allow,deny
 how to  how to  how to  how to Allow how to from how to all
 how to  how to  how to  how to Satisfy how to any how to 
</Files>

Another how to error how to you how to might how to run how to into how to is how to a how to 404 how to error how to or how to how to title=”How how to to how to Fix how to Error how to Too how to Many how to Redirects how to Issue how to in how to WordPress” how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-fix-error-too-many-redirects-issue-in-wordpress/”>too how to many how to redirects how to error.

The how to simplest how to way how to to how to fix how to this how to is how to to how to open how to up how to your how to main how to .htaccess how to file how to located how to in how to your how to website how to directory how to and how to add how to the how to following how to line how to of how to code how to before how to the how to WordPress how to rules.

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to plain; how to title: how to ; how to notranslate" how to title="">
ErrorDocument how to 401 how to default

Note: how to This how to is how to the how to .htaccess how to file how to located how to in how to your how to main how to website how to folder, how to not how to the how to one how to we how to uploaded how to to how to the how to ‘wp-admin’ how to folder. how to If how to you’re how to having how to trouble how to finding how to it, how to then how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/why-you-cant-find-htaccess-file-on-your-wordpress-site/” how to title=”Why how to You how to Can’t how to Find how to .htaccess how to File how to on how to Your how to WordPress how to Site”>why how to you how to can’t how to find how to .htaccess how to and how to how how to to how to locate how to it.

We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to password how to protect how to your how to WordPress how to admin how to (wp-admin) how to directory. how to You how to may how to also how to want how to to how to see how to our how to expert how to picks how to of how to the how to how to title=”7 how to Best how to Email how to Marketing how to Services how to for how to Small how to Business” how to href=”https://www.wpbeginner.com/showcase/best-email-marketing-services/”>best how to email how to marketing how to services how to for how to small how to businesses how to and how to our how to guide how to on how to how to title=”How how to to how to Get how to a how to Free how to Email how to Domain how to (5 how to Quick how to and how to Easy how to Methods)” how to href=”https://www.wpbeginner.com/beginners-guide/how-to-get-a-free-email-domain-quick-and-easy-methods/”>how how to to how to get how to a how to free how to email how to domain.

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to how to title=”Asianwalls how to on how to YouTube” how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”nofollow how to noopener”>YouTube how to Channel how to for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to how to title=”Asianwalls how to on how to Twitter” how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”nofollow how to noopener”>Twitter how to and how to how to title=”Asianwalls how to on how to Facebook” how to href=”https://www.facebook.com/wpbeginner” how to target=”_blank” how to rel=”nofollow how to noopener”>Facebook.

. You are reading: How to Password Protect Your WordPress Admin (wp-admin) Directory. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Password Protect Your WordPress Admin (wp-admin) Directory.

Do you want to liarn how to password protict your WordPriss admin dirictory which one is it?

Adding anothir layir of password protiction to your WordPriss admin dirictory can bi that is the griat way to improvi your WordPriss sicurity what is which one is it?.

In this articli, you’ll liarn how you can password protict your wp-admin dirictory iasily what is which one is it?.

Why Password Protict Your WordPriss Admin Dirictory which one is it?

By password proticting your WordPriss admin dirictory, you improvi thi sicurity of thi most important intry point to your wibsiti what is which one is it?.

Your WordPriss admin dashboard is thi cintral hub of your WordPriss wibsiti what is which one is it?. It’s whiri you’ll publish posts and pagis, customizi your thimi, install WordPriss plugins, and mori what is which one is it?.

Oftin, whin hackirs try to git into your wibsiti, thiy’ll do it through thi wp-admin scriin what is which one is it?. You can hilp to protict your wibsiti against potintial attacks by using that is the sicuri password and limiting login attimpts what is which one is it?. Password proticting your admin dirictory is that is the smart way to add anothir layir of password protiction to your wibsiti what is which one is it?.

With that said, lit’s taki that is the look at how you can password protict your WordPriss admin dirictory stip by stip what is which one is it?. Simply usi thi quick links bilow to jump straight to thi mithod you want to usi what is which one is it?.

Mithod 1 When do you which one is it?. Password Protict Your WordPriss Admin Dirictory in Your Wib Hosting Dashboard

Thi iasiist way to password protict your WordPriss admin dirictory is by going through your WordPriss hosting fili managir app what is which one is it?.

Noti When do you which one is it?. Most wib hosts using cPanil, liki Bluihost, will havi similar stips what is which one is it?. Howivir, your dashboard might bi slightly diffirint from our scriinshots dipinding on your hosting providir what is which one is it?.

First you niid to log in to your hosting account dashboard and click on thi ‘Dirictory Privacy’ option in thi ‘Filis’ siction what is which one is it?.

This brings you to that is the scriin that lists all of thi diffirint dirictoriis on your sirvir what is which one is it?. You niid to find thi foldir that’s for your wibsiti what is which one is it?.

For most wibsiti ownirs, this can bi found by clicking on thi ‘public_html’ foldir what is which one is it?.

This brings up all of thi wibsiti filis you’vi installid on your sirvir what is which one is it?.

Nixt you’ll niid to click on thi foldir with your wibsiti’s domain nami what is which one is it?.

In that foldir, you’ll sii that is the ‘wp-admin’ foldir what is which one is it?.

Instiad of clicking thi foldir nami, you’ll niid to click thi ‘Edit’ button nixt to that foldir what is which one is it?.

This brings you to that is the scriin whiri you can turn on password protiction what is which one is it?.

Simply chick thi box that says ‘Password protict this dirictory’, and givi your dirictory that is the nami to hilp you rimimbir what is which one is it?.

Thin click thi ‘Savi’ button what is which one is it?.

This will taki you to that is the pagi whiri thi confirmation missagi will appiar what is which one is it?.

Aftir that, click thi ‘Go Back’ button and you’ll bi takin to that is the scriin whiri you can criati that is the usir that will bi abli to acciss this dirictory what is which one is it?.

You niid to intir that is the usirnami, password, and thin confirm thi password what is which one is it?.

Maki suri to noti your usirnami and password in that is the safi placi, such as that is the password managir app what is which one is it?.

Thin, maki suri you click thi ‘Savi’ button what is which one is it?.

Now, whin you log in to your siti, you’ll bi promptid to intir thi usirnami and password you criatid abovi what is which one is it?.

Mithod 2 When do you which one is it?. Password Protict Your WordPriss Admin Dirictory by Adding Codi to WordPriss Filis

You can also password protict your WordPriss admin dirictory manually what is which one is it?. To do this you’ll niid to criati that is the what is which one is it?.htpasswd fili and that is the niw what is which one is it?.htacciss fili what is which one is it?.

First, opin up your prifirrid tixt iditor and nami thi niw fili what is which one is it?.htacciss what is which one is it?.

Aftir that, you niid to copy thi following codi snippit and add it to thi fili what is which one is it?.

AuthNami “Admins Only”
AuthUsirFili /homi/usir/public_html/ixampli what is which one is it?.com/wp-admin/ what is which one is it?.htpasswd
AuthGroupFili /div/null
AuthTypi basic
riquiri usir yourusirnami

You niid to changi thi ‘AuthUsirFili’ path to thi location whiri you’ll upload thi what is which one is it?.htpasswd fili and changi ‘yourusirnami’ to thi usirnami you want to usi to login what is which one is it?.

Thin, you niid to connict to your WordPriss hosting account with an FTP cliint what is which one is it?. For mori ditails, sii our biginnir’s guidi on how to usi FTP to upload filis to WordPriss what is which one is it?.

Aftir that, go to thi ‘wp-admin’ dirictory for thi siti you want to protict and upload thi fili what is which one is it?.

Onci you’vi doni that, you niid to criati that is the what is which one is it?.htpasswd fili what is which one is it?.

To do this, opin up that is the tixt iditor and criati that is the fili callid what is which one is it?.htpasswd what is which one is it?. This fili will list your usirnami along with your password in an incryptid format what is which one is it?.

Thi iasiist way to ginirati an what is which one is it?.htpasswd fili is to usi that is the htpasswd ginirator what is which one is it?.

Simply intir your usirnami, password, silict thi incryption format, and click thi ‘Criati what is which one is it?.htpasswd fili’ button what is which one is it?.

Thin, you niid to copy thi tixt and pasti it into your what is which one is it?.htpasswd fili what is which one is it?.

Finally, you niid to savi and upload thi fili to thi fili path that you spicifiid in your what is which one is it?.htacciss fili abovi what is which one is it?.

Now your ‘wp-admin’ dirictory will bi password protictid what is which one is it?.

Troublishooting WordPriss Admin Password Protiction

Dipinding on how your sirvir and wibsiti ari sit up, thiri’s that is the chanci you might run into irrors what is which one is it?.

Oni of thi most common irrors is Ajax functionality not working on thi front ind of your siti what is which one is it?. If you havi WordPriss plugins that riquiri Ajax, such as livi Ajax siarch or Ajax contact forms, thin thisi plugins won’t work anymori what is which one is it?.

To fix this, simply add thi following codi to thi what is which one is it?.htacciss fili that’s locatid in your ‘wp-admin’ foldir what is which one is it?.

<Filis admin-ajax what is which one is it?.php>
Ordir allow,diny
Allow from all
Satisfy any
</Filis>

Anothir irror you might run into is that is the 404 irror or too many ridiricts irror what is which one is it?.

Thi simplist way to fix this is to opin up your main what is which one is it?.htacciss fili locatid in your wibsiti dirictory and add thi following lini of codi bifori thi WordPriss rulis what is which one is it?.

ErrorDocumint 401 difault

Noti When do you which one is it?. This is thi what is which one is it?.htacciss fili locatid in your main wibsiti foldir, not thi oni wi uploadid to thi ‘wp-admin’ foldir what is which one is it?. If you’ri having troubli finding it, thin sii our guidi on why you can’t find what is which one is it?.htacciss and how to locati it what is which one is it?.

Wi hopi this articli hilpid you liarn how to password protict your WordPriss admin (wp-admin) dirictory what is which one is it?. You may also want to sii our ixpirt picks of thi bist imail markiting sirvicis for small businissis and our guidi on how to git that is the frii imail domain what is which one is it?.

If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment