Question How do I protect wp-admin directory? Print

  • best hosting provider, shared hosting guide, VPS hosting setup, GHFS cloud hosting, GHFS Hosting, managed hosting services, GHFS web hosting, domain and hosting tutorials, SSD web hosting, email hosting setup, how to register a domain, DNS configuration guide, how to transfer a domain, hosting knowledge base, SSL installation guide, hosting control panel tutorial, DNS records explained, A record guide, WordPress migration guide, WordPress installation GHFS, SSL certificate troubleshooting, CNAME configuration, optimize WordPress performance, MX record setup, fix internal server error, FTP upload guide, secure VPS server, Linux server commands, enable SSH access, MySQL database tutorial, PHP configuration guide, website security tutorial, malware removal guide, DDoS protection GHFS, secure hosting best practices, disable root login SSH, firewall configuration VPS, VPS hosting tutorial, how to manage Linux VPS, cloud server configuration, Nginx setup GHFS, Apache configuration guide, Node.js on VPS, install Docker on VPS, Python hosting tutorial, Redis installation, MySQL optimization, hosting troubleshooting guide, SSL troubleshooting, secure website setup, hosting performance optimization, cPanel tutorial, Plesk tutorial, email deliverability guide, server hardening tutorial, SMTP configuration guide
  • 0

Answer : 

The wp-admin directory is the core control panel of your WordPress site. Because it is targeted frequently by bots and attackers, securing it is one of the most important steps in WordPress hardening.

GHFS Hosting provides several methods to protect your wp-admin folder using Plesk tools and .htaccess rules.


1. Protect wp-admin with Password Protection (Plesk)

This adds an extra login layer before the WordPress login screen.

Steps:

  1. Log in to your Plesk panel

  2. Go to Websites & Domains

  3. Open File Manager

  4. Navigate to:

 
 
/httpdocs/wp-admin/
  1. Click the three dots (⋮) next to the folder

  2. Select Password-Protect This Directory

  3. Create a username and password

  4. Save

Now visitors must enter this password before reaching the WordPress login page.


2. Restrict wp-admin to Specific IP Addresses (Advanced Security)

If you have a static IP, you can restrict access so only your IP is allowed.

Add this to .htaccess inside wp-admin:

 
 
Order deny,allow Deny from all Allow from YOUR_IP

Example:

 
 
Allow from 123.45.67.89

If multiple IPs:

 
 
Allow from 123.45.67.89 Allow from 98.76.54.32

3. Deny Access to wp-login.php Except Certain IPs

To block attacks on the login page, protect wp-login.php using:

Place this in the .htaccess located in /httpdocs/:

 
 
<Files wp-login.php> Order deny,allow Deny from all Allow from YOUR_IP </Files>

4. Enable WordPress Limit Login Attempts (Plugin)

Install a security plugin such as:

  • Limit Login Attempts Reloaded

  • Wordfence

  • iThemes Security

These plugins help block brute-force attempts.


5. Enable reCAPTCHA on Login Page

Many security plugins allow you to add Google reCAPTCHA to:

  • wp-login.php

  • Lost password form

  • Registration form

This reduces bot attacks significantly.


6. Move wp-login.php (Optional)

Plugins like WPS Hide Login allow you to change:

 
 
yourdomain.com/wp-login.php

to something like:

 
 
yourdomain.com/mysecurepanel/

This does not replace other protections but adds another layer.


7. Disable File Editing from WordPress Admin

Add this line to wp-config.php:

 
 
define( 'DISALLOW_FILE_EDIT', true );

This prevents hackers from editing theme and plugin files if they gain admin access.


8. When to Contact GHFS Hosting Support

Contact support if:

  • Password protection is not working

  • You accidentally blocked yourself

  • Your .htaccess rules cause errors

  • You want stronger server-level protection

  • You see repeated brute-force attacks

Support can set up or restore your protection settings.


Was this answer helpful?

« Back