Built for Hostnasi-hosted WordPress sites
Harden your WordPress site in minutes, not hours.
Hostnasi Security scans your site against 22 industry-standard security checks, shows a live 0–100% security score, and fixes 15 of those checks automatically — no technical knowledge required.
Default WordPress site
3–4 of 22 checks passing
After Hostnasi Security
18–22 of 22 checks passing
Why this plugin
A freshly installed WordPress site with default settings typically passes fewer than 5 of these 22 checks. WordPress powers 43% of the web, making it the most targeted platform for automated attacks. Hostnasi Security closes the most common gaps in minutes — directly from your WordPress admin dashboard.
What it checks — and fixes
Six hardening categories cover authentication, configuration, file permissions, updates, HTTP headers, and information leakage.
🔐 Authentication & login
4 checks · 3 auto-fixable
- Remove default "admin" username
- Limit login attempts (lockout after 5 fails)
- Hide wp-login.php from bots
- Disable XML-RPC
⚙️ wp-config.php hardening
5 checks · 3 auto-fixable
- Disable theme/plugin file editor
- Force HTTPS for wp-admin
- Non-default database table prefix
- WP_DEBUG disabled on production
- Security keys & salts are set
📁 File & directory permissions
4 checks · 4 auto-fixable
- wp-config.php permissions (440/400)
- PHP execution blocked in /uploads/
- Directory listing disabled
- .htaccess & sensitive files protected
🔄 Updates & plugins
4 checks · 1 auto-fixable
- WordPress core is up to date
- No plugins with pending updates
- No inactive plugins installed
- Minor core auto-updates enabled
🛡️ HTTP security headers
3 checks · 3 auto-fixable
- X-Frame-Options (clickjacking)
- X-Content-Type-Options (MIME sniffing)
- Referrer-Policy
🔍 Information leakage
3 checks · 3 auto-fixable
- Block user enumeration
- WordPress version hidden
- readme.html deleted from root
Built-in features — no third-party plugins needed
- Login lockout — blocks IPs after 5 failed attempts for 30 minutes
- Hidden login URL — moves wp-login.php to a secret random slug
- XML-RPC disable
- Security headers (X-Frame-Options, HSTS, Referrer-Policy, Permissions-Policy)
- User enumeration block (/?author= and REST API /wp/v2/users)
- WordPress version hiding (meta tags, feeds, asset query strings)
- wp-config.php constant patching (DISALLOW_FILE_EDIT, FORCE_SSL_ADMIN, WP_DEBUG)
- .htaccess hardening (PHP block in uploads, directory listing, sensitive file protection)
- wp-config.php permission fix (chmod 440)
- readme.html deletion
Using the dashboard
Navigate to HN Security in your WordPress admin sidebar after activation. The scan runs immediately.
Security score
- Good — 80% and above
- Needs work — 50–79%
- At risk — below 50%
The score updates live in the browser after each auto-fix — no page reload required.
Fix buttons
Each failing check shows one of two things:
- Green "Fix" button — click once; the fix applies via AJAX and the check turns green
- "Manual fix required" tag — the fix must be done outside the plugin
Hidden login URL
After enabling the hidden login URL, a green info box at the bottom of the dashboard shows your new login address, e.g. https://yoursite.com/secure-xk3p9mz2/.
⚠️ Bookmark this immediately. Direct access to /wp-login.php will be blocked for bots — and for you if you forget the slug.
Installation
Two ways to install — pick whichever fits how you manage your site.
Method A — WordPress admin
- Download
hostnasi-security.zipbelow - In your WordPress admin, go to Plugins → Add New → Upload Plugin
- Choose
hostnasi-security.zipand click Install Now - Click Activate Plugin
- Navigate to HN Security in the sidebar — the scan runs immediately
Method B — FTP / cPanel File Manager
- Extract
hostnasi-security.zipon your computer - Upload the
hostnasi-security/folder to/wp-content/plugins/on your server - Activate via Plugins → Installed Plugins
Requirements
| Requirement | Minimum |
|---|---|
| WordPress | 6.0 |
| PHP | 8.0 |
| User role | Administrator |
| Web server | Apache or LiteSpeed (Nginx: partial support) |
Manual steps guide — checks the plugin can't fix automatically
Remove the "admin" username
- Go to Users → Add New in your admin panel
- Create a new Administrator account with a unique username (not
admin) - Log out, then log back in as the new account
- Go to Users, find the old
adminaccount, click Delete - When prompted, choose to reassign all content to your new account
Change the database table prefix
Best done at install time — set wp_ to something unique (e.g. hn7x_) during the WordPress installation wizard.
For existing live sites: back up your database, use a plugin such as Brozzme DB Prefix & Tools Addons, or contact Hostnasi support — we can do it for you.
Set strong security keys and salts
- Visit api.wordpress.org/secret-key/1.1/salt/ to generate a fresh set
- Open
wp-config.phpvia cPanel File Manager or FTP - Replace the block starting with
define('AUTH_KEY',with the generated keys - Save — all current sessions will be invalidated (all users must log in again)
Update WordPress core & plugins
Go to Dashboard → Updates, update plugins first, then core. Enable auto-updates for extra safety.
Delete inactive plugins
Go to Plugins → Installed Plugins, filter by Inactive, select all, then Bulk Actions → Delete.
Security checks reference
Every check the scanner runs, grouped by category, with severity and auto-fix status.
🔐 Authentication & login 4 checks
Every brute-force bot tries admin as the first username. Rename or delete this account.
Blocks IPs after 5 failed logins within 10 minutes, for 30 minutes. Reads CF-Connecting-IP behind Cloudflare.
Moves the login page to a secret secure-[random] slug. Bots can't attack a page they can't find.
Prevents amplified login-attempt and DDoS abuse via XML-RPC, unless your app or Jetpack needs it.
⚙️ wp-config.php hardening 5 checks
Inserts DISALLOW_FILE_EDIT so a compromised admin password can't become arbitrary code execution.
Inserts FORCE_SSL_ADMIN. Requires an active SSL certificate — fails if the site isn't served over HTTPS.
The default wp_ prefix makes SQL injection easier to exploit. Safest to set at install time.
Debug mode leaks file paths and stack traces to visitors. The plugin sets WP_DEBUG to false.
Checks that all four primary keys are defined and at least 40 characters. Default/missing keys make stolen cookies reusable.
📁 File & directory permissions 4 checks
chmod 0440 — your database credentials become unreadable to other users on shared hosting.
Breaks the common attack chain of uploading disguised .php files through vulnerable plugins.
Adds Options -Indexes so directories without an index file don't expose a file browser.
Blocks direct HTTP access to config and log files that should never be public.
🔄 Updates & plugins 4 checks
Outdated core has publicly disclosed CVEs that automated scanners actively exploit.
Vulnerable plugins are the #1 attack vector on WordPress.
Inactive plugins are still on the filesystem and still exploitable — delete, don't just deactivate.
Minor WordPress releases are almost always security patches — applied automatically.
🛡️ HTTP security headers 3 checks
All header checks share one toggle — enabling any one enables all five headers, including HSTS on HTTPS sites.
Prevents your site being embedded in an iframe on another domain — stops clickjacking.
Stops browsers from MIME-sniffing responses into executable content.
strict-origin-when-cross-origin keeps full admin URLs out of referrer headers.
🔍 Information leakage 3 checks
Redirects /?author=N and removes /wp/v2/users from the REST API for unauthenticated visitors.
Strips the version from meta tags, RSS feeds, and ?ver= query strings on assets.
Removes the file that publicly displays your exact WordPress version number.
All fixes apply via a nonce-verified AJAX request, restricted to Administrator users, and checked against a whitelist of 15 allowed methods before execution — no arbitrary code execution is possible.
Compatibility
| Environment | Status |
|---|---|
| WordPress 6.0–6.7 | ✅ Fully supported |
| PHP 8.0, 8.1, 8.2, 8.3 | ✅ Fully supported |
| Apache | ✅ All features |
| LiteSpeed | ✅ All features |
| Nginx | ⚠️ Headers and lockout work; .htaccess fixes need manual location blocks |
| Cloudflare proxy | ✅ Lockout reads CF-Connecting-IP |
| WordPress Multisite | ❌ Not tested — single-site installs only |
| Wordfence / Sucuri | ✅ Fully compatible — complementary, no conflicts |
| WP Super Cache / W3TC / LiteSpeed Cache | ✅ Compatible |
Nginx equivalents for .htaccess fixes
# Block PHP in uploads
location ~* /wp-content/uploads/.*\.php$ {
deny all;
}
# Disable directory listing
autoindex off;
# Protect sensitive files
location ~* ^/(\.htaccess|wp-config\.php|debug\.log|readme\.html|license\.txt)$ {
deny all;
}
Troubleshooting
I'm locked out after enabling the hidden login URL
The login slug is stored in the database. Retrieve it via phpMyAdmin:
SELECT option_value FROM wp_options WHERE option_name = 'hns_login_slug';
Or via WP-CLI:
wp option get hns_login_slug
Navigate to https://yoursite.com/{slug}/ to log in. To disable the feature entirely:
wp option update hns_hide_login_enabled 0
wp rewrite flush
wp-config.php fix says "not writable"
After the chmod 440 fix, wp-config.php becomes non-writable by the web process. Via SSH:
chmod 640 wp-config.php
# Apply fix via dashboard
chmod 440 wp-config.php
Or add the define() manually using cPanel File Manager's Text Editor.
.htaccess fix applied but the check still fails
- Clear your caching plugin's file cache
- On Nginx, .htaccess has no effect — use the Nginx equivalents above
- Verify .htaccess isn't overridden by a parent directory's
AllowOverride None
FORCE_SSL_ADMIN fix returns an error
The plugin checks is_ssl() first. If SSL terminates at a load balancer or Cloudflare, add this to wp-config.php before retrying:
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
Score isn't updating after a fix
- Hard refresh the page (Ctrl/Cmd+Shift+R)
- Go to Settings → Permalinks and click Save Changes to flush rewrites
- Some checks (e.g. DISALLOW_FILE_EDIT) only appear on the next page load after wp-config.php is patched
Ready to harden your site?
Free for Hostnasi-hosted customers. Install in under five minutes.