The Custom Login URL feature lets you hide your WordPress admin login page by using a unique URL instead of the default /wp-login.php and /wp-admin. This is one of the most effective ways to prevent automated bot attacks on your site.
Why Use a Custom Login URL?
WordPress sites are constantly targeted by automated bots that attempt to log in to /wp-login.php with common username/password combinations. By changing your login URL:
- Eliminate 90%+ of automated attacks – Bots can’t find your login page
- Reduce server load – Fewer malicious login attempts
- Clean up your logs – Stop filling activity logs with bot attempts
- Improve performance – Less processing of failed login attempts
How It Works
When you set a custom login slug, Guard Dog:
- Intercepts requests to your custom URL and displays the login form
- Blocks direct access to
/wp-login.php(redirects to 404) - Allows essential functions like password reset and logout
- Updates all login links throughout WordPress to use your custom URL
The system works on all server types (Apache, Nginx, Litespeed) without requiring special configuration.
Setting Up Custom Login URL
Step 1: Choose Your Login Slug
Navigate to Guard Dog → Login Security and find the Custom Login URL section.
Good examples:
secure-entrancebackend-accessmy-secret-doorportal-2024
Avoid these:
admin,login,wp-admin(too obvious)secure,private(commonly guessed)- Your company name (easily guessed)
- Numbers only (not memorable)
Tips:
- Use a combination of words and numbers
- Make it memorable but not guessable
- Consider rotating it periodically for high-security sites
Step 2: Enter Your Slug
- Type your chosen slug in the Login Slug field
- The slug should only contain:
- Lowercase letters (a-z)
- Numbers (0-9)
- Hyphens (-)
- Click Save Changes
Step 3: Bookmark Your New URL
This is critical! Your new login URL will be:
https://yoursite.com/your-slug
Add this to your browser bookmarks immediately. If you forget it, you’ll need to access your site files to recover access.
Step 4: Test Your New URL
- Open a private/incognito browser window
- Try accessing
yoursite.com/wp-admin– should redirect to 404 - Try accessing
yoursite.com/wp-login.php– should redirect to 404 - Access
yoursite.com/your-slug– should show the login form - Log in successfully
What Happens to the Old URLs?
/wp-login.php and /wp-admin
Direct access to these URLs is blocked and redirects to a 404 page except for:
- Password reset requests – The
/wp-login.php?action=lostpasswordcontinues to work - Password reset confirmation – Reset links sent via email still work
- Logout requests –
/wp-login.php?action=logoutcontinues to work - Form POST requests – Login form submissions are processed normally
This ensures that essential WordPress functions continue working while blocking unauthorized access.
Login Links Throughout WordPress
Guard Dog automatically updates login URLs in:
- WordPress admin bar
- Login/logout links in themes
- WordPress core login redirects
- Password reset emails
- Custom login widgets
Using Custom Login URL with Other Features
With CAPTCHA
When you enable CAPTCHA protection, it will appear on your custom login URL automatically. The CAPTCHA verification happens seamlessly regardless of which login URL you use.
With Two-Factor Authentication
After entering your username and password on the custom login URL, you’ll be prompted for your 2FA code as normal. The 2FA flow works identically on the custom URL.
With Login Attempt Limiting
Login attempts are tracked by IP address regardless of which URL is accessed. If a bot somehow finds your custom login URL, they’ll still be locked out after too many failed attempts.
With Temporary User Access
Temporary user access links automatically work with your custom login URL. When a temporary user clicks their access link, they’re logged in through the custom URL seamlessly.
Advanced Usage
Multiple Administrators
If you have multiple administrators:
- Share the custom login URL securely (encrypted messaging, password manager)
- Consider using a password manager’s secure sharing feature
- Update all saved bookmarks
- Document it in your internal security documentation
Rotating Your Login URL
For high-security sites, consider changing your login URL periodically:
- Go to Guard Dog → Login Security
- Change the Login Slug to a new value
- Save changes
- Update all administrator bookmarks
- Notify all users of the new URL
Recommended rotation: Every 6-12 months for high-security sites.
Server Configuration
The custom login URL feature is server-agnostic and requires no special configuration:
- Apache: Works without
.htaccessmodifications - Nginx: Works without nginx.conf changes
- Litespeed: Works without special rules
- Cloud hosting: Works on all major platforms
No rewrite rules or server configuration needed!
Troubleshooting
I Forgot My Custom Login URL
Solution 1: Check Your Database
- Access phpMyAdmin or your database tool
- Look in the
wp_optionstable - Find the row where
option_name=guard_dog_login_slug - The
option_valuecolumn shows your login slug
Solution 2: Disable the Plugin Temporarily
- Via FTP or File Manager, navigate to
/wp-content/plugins/ - Rename the
guard-dogfolder toguard-dog-disabled - Access
/wp-login.phpnormally - Rename the folder back to
guard-dog - Check the setting in Guard Dog admin
Solution 3: Reset via wp-config.php
Add this line temporarily to wp-config.php:
define('GUARD_DOG_BYPASS', true);
This disables all Guard Dog protection temporarily. Remove it after recovering access.
Custom Login URL Not Working
Check these common issues:
- Slug is empty – Make sure you entered a value
- Caching conflict – Clear your site cache and browser cache
- Permalink structure – Go to Settings → Permalinks and click Save
- Plugin conflict – Temporarily disable other security plugins
- Server caching – Clear server-level caching (Varnish, Redis, etc.)
Getting 404 on Both URLs
If both your custom URL and /wp-login.php show 404:
- Flush rewrite rules – Go to Settings → Permalinks → Save Changes
- Check plugin is active – Ensure Guard Dog is activated
- File permissions – Ensure WordPress can write to database
- Clear all caches – Browser, plugin, server
Redirect Loop When Accessing Custom URL
Causes:
- Another plugin also modifying login URLs
- Incorrect server redirect rules
- Caching issue
Solutions:
- Disable other security plugins one by one
- Remove any custom login redirects in
.htaccess - Clear all caches
- Check for hardcoded redirects in your theme
Login Forms from Plugins Not Working
Some plugins include their own login forms. Update these plugins to use the WordPress wp_login_url() function, which Guard Dog filters automatically.
For plugin developers, always use:
$login_url = wp_login_url();
Never hardcode:
$login_url = '/wp-login.php'; // ❌ Don't do this
Security Considerations
Is Custom Login URL Enough?
No. While effective against automated bots, a custom login URL should be part of a multi-layered security approach:
- Custom Login URL – Stops automated bots (this feature)
- CAPTCHA – Stops automated tools that find your URL
- Login Limiting – Stops brute-force attempts
- 2FA – Protects against password theft
- Access Control – Restricts by IP or username
Use all these features together for comprehensive protection.
Security Through Obscurity?
Custom login URLs are often criticized as “security through obscurity.” While true, they’re still valuable:
- First line of defense – Eliminates most attacks before they start
- Reduces attack surface – Fewer requests to process
- Complements other security – Works alongside strong authentication
- Proven effective – Used by millions of WordPress sites successfully
Think of it like locking your front door. A determined attacker could pick the lock, but it still stops most intrusions.
Can Attackers Find My Custom URL?
Potentially, yes:
- Brute force scanning – Trying common URL patterns
- Information disclosure – Poorly coded themes revealing the URL
- Social engineering – Tricking users into revealing it
Mitigations:
- Use a non-obvious, unique slug
- Enable CAPTCHA as a second layer
- Enable login limiting to stop brute-force
- Don’t share the URL publicly
Best Practices
- Set it immediately after installing Guard Dog
- Bookmark it in multiple places (password manager, browser)
- Don’t share it publicly (blog posts, forum signatures, etc.)
- Change it if compromised (rotate periodically for high-security sites)
- Document it securely for team members
- Combine with other features (CAPTCHA, 2FA, login limiting)
- Test in incognito mode before logging out of your current session
FAQ
Q: Will this break plugins or themes?
A: No. Guard Dog properly filters all WordPress login URL functions. Well-coded plugins and themes will work automatically.
Q: Can I use special characters in my slug?
A: Only lowercase letters, numbers, and hyphens are allowed for maximum compatibility.
Q: Does this work with multisite?
A: Custom login URLs work on WordPress multisite installations.
Q: Will users see a 404 error?
A: Yes, attempts to access /wp-login.php directly will see a 404 page. This is intentional and prevents attackers from knowing WordPress is installed.
Q: Can I set different login URLs for different users?
A: No. There is one custom login URL for the entire site. All users must use the same URL.
Q: Will this slow down my site?
A: No. The custom login URL check is extremely lightweight and has negligible performance impact.