A production-ready WordPress plugin that allows administrators to change the default /wp-login.php URL to a custom slug for enhanced security.
- ✅ Custom Login Slug: Change
/wp-login.phpto any custom URL (e.g.,/secure-login) - ✅ Admin Settings Page: Easy-to-use interface under Settings → Custom Login URL
- ✅ Flexible Blocking: Choose to redirect to homepage or show 404 for default login URL
- ✅ Security Focused: Hides the default WordPress login page from bots and attackers
- ✅ Clean Code: Modular, object-oriented architecture following WordPress coding standards
- ✅ No Inline Styles/Scripts: All CSS and JavaScript in separate files
- ✅ Translation Ready: Fully internationalized with text domain
- ✅ Multisite Compatible: Works with WordPress multisite installations
- Upload the plugin folder to
/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Go to Settings → Custom Login URL to configure
- Enter your desired login slug and save settings
- Important: Bookmark your new login URL immediately!
- Navigate to Settings → Custom Login URL
- Enter your desired login slug (e.g.,
secure-login,admin-access) - Choose what happens when someone visits
/wp-login.php:- Redirect to homepage (recommended)
- Show 404 error page
- Click "Save Settings"
- Only lowercase letters, numbers, and hyphens allowed
- Cannot be empty
- Cannot use reserved slugs:
wp-admin,wp-content,wp-includes,admin,login,wp-login
After configuration, access your login page at:
https://yoursite.com/your-custom-slug
All WordPress login-related URLs will automatically update:
- Login:
https://yoursite.com/your-custom-slug - Logout:
https://yoursite.com/your-custom-slug?action=logout - Lost Password:
https://yoursite.com/your-custom-slug?action=lostpassword - Register:
https://yoursite.com/your-custom-slug?action=register
If you forget your custom login URL:
- Connect to your site via FTP or File Manager
- Navigate to
/wp-content/plugins/ - Rename the
sanaloginhidefolder tosanaloginhide-disabled - Access
/wp-login.phpnormally
- Access phpMyAdmin or your database management tool
- Open your WordPress database
- Find the
wp_optionstable - Search for
clu_login_slugoption to view your custom slug
sanaloginhide/
├── custom-login-url.php # Main plugin file
├── uninstall.php # Uninstall cleanup script
├── includes/
│ ├── class-clu-settings.php # Settings page handler
│ └── class-clu-handler.php # Login URL handler
└── assets/
├── css/
│ └── admin.css # Admin styles
└── js/
└── admin.js # Admin JavaScript
- WordPress 5.0 or higher
- PHP 7.2 or higher
- Apache with mod_rewrite or Nginx with proper configuration
Solution: Go to Settings → Permalinks and click "Save Changes" to flush rewrite rules.
Solution:
- Deactivate and reactivate the plugin
- Clear your browser cache
- Clear server/plugin cache if using caching
Solution: Use one of the recovery methods listed above.
- Bookmark Your Login URL: Save it in a password manager
- Test Before Production: Try on staging site first
- Inform Team Members: Share the new URL with all admins
- Use Strong Slug: Choose something unique but memorable
- Regular Backups: Always maintain site backups
This plugin enhances security through obscurity but should not be your only security measure. Always use strong passwords, keep WordPress updated, and implement additional security measures.
This plugin is licensed under the GPL v2 or later.
For support, feature requests, or bug reports, please contact your administrator.