WordPress Logo – Athemeart WordPress Themes

How to Hide WP Admin URL in WordPress (With or Without a Plugin)

Hide WP admin URL illustrationBots hit the default wp-admin and wp-login.php addresses and get a 404, while the site owner logs in through a custom login URL.example.com/wp-admin404Nothing to see here, bot./wp-login.php → blockedexample.com/team-portalLog InHide WP Admin URL: bots get a dead end, you get a private door
Hiding the WordPress admin URL sends automated login bots to a 404 page while you sign in through your own custom address.

Every WordPress site on the planet shares the same two front doors: /wp-admin and /wp-login.php. Bots know this, which is why your login page probably gets hammered every day by scripts guessing usernames and passwords. Wordfence alone reported blocking , up 13.8% on the previous quarter.

If you want to hide the WP admin URL, this guide shows you every reliable way to do it: the one-minute plugin method, a lightweight code method that needs no plugin, and server-level rules for Apache and Nginx. You will also learn how to hide the WP admin bar, how to test your new login URL without locking yourself out, how to fix the most common errors, and which extra security layers matter far more than the URL itself.

Quick answer: The fastest way to hide your WordPress admin URL is to install the free WPS Hide Login plugin, go to Settings → General, type a new login slug (for example team-portal), and click Save Changes. After that, /wp-admin and /wp-login.php return a 404 for logged-out visitors, and only your custom URL shows the login form.

1. Introduction: Why Hide Your WordPress Admin URL?

Before you change anything, it helps to know exactly what you are hiding, what it protects you from, and where its limits are. Most tutorials skip that last part. We won’t.

What is the default WordPress admin URL?

A fresh WordPress install exposes its login and dashboard at predictable addresses:

URL What it does Who sees it
example.com/wp-login.php The actual login form (also handles logout, lost password and password reset) Everyone
example.com/wp-admin/ The dashboard. Logged-out visitors are redirected to wp-login.php Everyone (redirect)
example.com/login and /admin Shortcut redirects WordPress adds to the login page and dashboard Everyone
example.com/wp-admin/admin-ajax.php Background requests used by themes and plugins on the front end Must stay public

Because these paths are identical on millions of sites, an attacker doesn’t need to research your site at all. A script simply requests /wp-login.php on a long list of domains and starts guessing.

Why should you hide or change wp-admin?

Changing the WordPress login URL won’t make a weak password strong, but it does deliver real, practical benefits:

  • Fewer automated login attempts. Most brute-force bots only try the default paths. Move the door and the bulk of that noise stops reaching your login form.
  • Less server load. Every login attempt runs PHP and a database query. Thousands of bot hits a day waste CPU on cheap shared hosting and can slow your site for real visitors.
  • Cleaner security logs. When failed logins drop from hundreds to near zero, the attempts that do show up are worth investigating.
  • Better client experience. A branded login URL like /client-area looks more professional than /wp-login.php for agency and membership sites.
  • Hides an easy fingerprint. A public wp-login.php is one of the quickest ways to tell a site runs WordPress.

Does hiding the WordPress login URL improve security?

Yes, but only as one layer. Hiding wp-admin is what security people call security through obscurity. The official WordPress hardening documentation calls obscurity that still has value in specific places, and that is the right way to see it.

A custom login URL stops untargeted, automated attacks. It does not stop someone who finds your URL in a leaked email, a hardcoded theme link, or a misconfigured cache. It also does nothing against vulnerable plugins, which are where most real WordPress compromises come from. So treat this guide’s method as the “lock the gate” step, and pair it with the layers in section 9.

Hide the login URL to cut the noise. Use strong passwords, two-factor authentication and login limits to stop the attack.

2. What to Know Before Hiding Your WordPress Admin URL

Changing the login path touches the one page you need to get back into your site. Five minutes of preparation prevents an afternoon of lockout recovery.

Back up your WordPress website

Take a full backup of your files and database before you start. Your host’s control panel backup, a backup plugin, or a staging copy all work. If something goes wrong with a code snippet, you can restore in minutes instead of editing files over FTP under pressure. If you’re unsure where your site stands overall, run a quick security audit first so you have a baseline.

Also make sure you have at least one way to edit files outside WordPress: your host’s File Manager, SFTP, or SSH. That’s your emergency exit if the new login URL fails.

Understand wp-admin vs. wp-login.php

These two paths are often treated as the same thing, but they behave differently, and that difference matters for every method below.

wp-admin vs wp-login.php request flowA visitor requests wp-admin. If logged in they see the dashboard. If not, WordPress redirects them to wp-login.php, which shows the login form and then returns them to the dashboard.Visitorrequests /wp-adminLoggedin?YesDashboardwp-admin loadsNo302 → wp-login.phplogin form (the real target)afterloginHiding the admin URL really means hidingwp-login.phpand stopping wp-admin from revealing it.
wp-admin is the dashboard; wp-login.php is the door. Logged-out requests to wp-admin are redirected to the login page, which is why both must be handled.
  • wp-login.php is a physical file in your WordPress root. It renders the login form and also handles logout, “lost password”, password reset links in emails, and password-protected posts.
  • wp-admin is a folder. When a logged-out visitor opens it, WordPress redirects them to wp-login.php, which reveals the login page even if you have “hidden” it.
  • admin-ajax.php lives inside wp-admin but must stay reachable for everyone. Contact forms, live search, WooCommerce cart fragments and many plugins call it from the front end. Blocking it breaks your site.

A good method hides wp-login.php, stops /wp-admin from redirecting to it, and leaves admin-ajax.php and logout and password-reset flows working.

Choose a suitable method for your website

There is no single best way. Choose based on your skills, your hosting, and how many people log in.

Which method should you use to hide wp-admin?Three method cards: plugin for beginners and most sites, custom PHP code for developers who want no extra plugin, and server-level rules for fixed IP teams and agencies.Which method should you use?PluginWPS Hide Login✓ 2 minutes, no code✓ Easy to undo✓ Works on any hostBest for: most sitesCustom PHP codemu-plugin snippet✓ No extra plugin✓ Full control! Needs file accessBest for: developersServer rules.htaccess / Nginx✓ Blocks before PHP runs✓ Strongest layer! Needs fixed IP or authBest for: teams, agencies
Pick the plugin method for speed, code for a plugin-free setup, or server rules when you want requests blocked before WordPress even loads.
Method Skill level Performance impact Blocks bots before PHP? Risk of lockout
WPS Hide Login plugin Beginner Very low (single-purpose) No Low, easy to undo
Security suite (AIOS, Kadence Security) Beginner Medium (many modules) Partly (firewall rules) Low to medium
Custom PHP mu-plugin Intermediate Lowest (a few lines) No Medium
.htaccess / Nginx IP allowlist Advanced Zero WordPress overhead Yes Medium if your IP changes
HTTP Basic Auth on wp-login.php Intermediate Zero WordPress overhead Yes Low

The performance column matters more than people expect. A single-purpose plugin or a few lines of code adds almost nothing to page load. A full security suite loads dozens of modules on every request, so only choose one if you will actually use its other features. If speed is a concern, measure your page load time before and after you add any security plugin, and drop modules you don’t use.

3. How to Hide WP Admin URL Using a Plugin

For most site owners, a plugin is the safest way to change the WordPress login URL. We’ll use , a free plugin with more than 2 million active installs. It doesn’t rename core files or add rewrite rules. It intercepts page requests instead, so deactivating it returns everything to normal.

Step 1: Install and activate WPS Hide Login

  1. Log in to your dashboard and go to Plugins → Add New Plugin.
  2. Search for WPS Hide Login.
  3. Click Install Now, then Activate.

Prefer the command line? With WP-CLI it’s one line:

wp plugin install wps-hide-login --activate

Step 2: Configure a custom WordPress login URL

WPS Hide Login doesn’t add its own menu. Its settings sit at the bottom of Settings → General.

WPS Hide Login settings screen in WordPressWordPress Settings General page scrolled to the WPS Hide Login section, with Login url set to team-portal, Redirection url set to 404, and the Save Changes button.W My Site + NewHowdy, adminDashboardPostsMediaPagesAppearancePluginsUsersToolsSettingsGeneralWritingReadingGeneral Settings… Site Title, Tagline, WordPress Address, Timezone and other default fields …WPS Hide LoginNeed help? Try the support forum. This plugin is not officially supported by WordPress.Login urlhttps://example.com/team-portal/Protect your website by changing the login URL and preventing access to wp-login.php and wp-admin.Redirection urlhttps://example.com/404/Redirect URL when someone tries to access wp-login.php or wp-admin while not logged in.Save Changes① New login slug② Where bots go③ Save, then bookmark the new URL
The WPS Hide Login fields at the bottom of Settings → General (recreated screen). Set a login slug, choose a redirection page for blocked requests, then save.
  1. Go to Settings → General and scroll to the WPS Hide Login section.
  2. In Login url, enter your new slug. Pick something memorable to you but not guessable. Avoid login, admin, signin, dashboard or your brand name. Something like team-portal-48 or studio-access works well.
  3. In Redirection url, enter where blocked visitors should land. The default 404 is ideal because it tells bots there is nothing there.

Tip: Use lowercase letters, numbers and hyphens only. Spaces, slashes and special characters can break the slug or clash with page permalinks. Also make sure no existing page or post already uses the same slug.

Step 3: Save settings and test your new login URL

  1. Click Save Changes. A notice at the top shows your new login address.
  2. Bookmark it immediately and save it in your password manager.
  3. Open a private or incognito window and visit the new URL. You should see the normal login form.
  4. In the same private window, visit /wp-admin and /wp-login.php. Both should show your 404 page.
  5. Log in through the new URL to confirm everything works end to end.

Keep your original browser tab logged in until the private-window test passes. If something is wrong, you can fix it from the session you already have.

If you use a page caching plugin, add the new slug to its “never cache” list. WPS Hide Login’s documentation says WP Rocket is handled automatically, but other cache plugins and server caches may need a manual exclusion.

How to restore the default login URL

Forgot your custom URL, or need to undo the change? Pick whichever option fits your access level.

Option A: From the dashboard (if you’re still logged in). Go to Settings → General and clear or change the slug, or simply deactivate the plugin under Plugins. The default wp-login.php returns instantly.

Option B: Rename the plugin folder (no dashboard access). Connect with your host’s File Manager or SFTP, open /wp-content/plugins/, and rename wps-hide-login to wps-hide-login-off. WordPress deactivates it, and /wp-login.php works again. Log in, rename the folder back, and reactivate.

Option C: Look up the slug in the database. The plugin stores your slug in the wp_options table under the whl_page option. In phpMyAdmin, run:

SELECT option_value FROM wp_options WHERE option_name = 'whl_page';

Replace wp_ with your table prefix if it’s different. On Multisite, check the wp_sitemeta table if the option isn’t in wp_options.

Option D: WP-CLI (fastest if you have SSH).

# Show the current custom login slug
wp option get whl_page

# Or turn the plugin off to restore wp-login.php
wp plugin deactivate wps-hide-login

If you’ve also lost your password, our guide to reset your WordPress admin password walks through phpMyAdmin and WP-CLI recovery step by step.

4. How to Hide WP Admin URL Without a Plugin

Not every site needs another plugin. If you’re comfortable editing files, you can hide wp-admin with a small piece of PHP, server rules, or both. The code below is written to keep logout, password reset emails and admin-ajax.php working, which is where most copy-paste snippets on the web fall short.

Before you paste code: Test on a staging site first, keep a logged-in tab open, and have SFTP or File Manager access ready. Never edit a parent theme’s functions.php, because theme updates erase it. Use a must-use plugin (recommended below) or a child theme.

Method 1: Use custom PHP code (mu-plugin)

A must-use plugin (mu-plugin) loads automatically, can’t be deactivated by accident from the dashboard, and survives theme switches. That makes it the right home for a login gate.

How it works: visiting your secret slug sets a short-lived cookie and sends you to the real login form. Anyone who opens wp-login.php or /wp-admin without that cookie gets a 404. Logout, password reset links and password-protected posts are allowed through.

  1. Using File Manager or SFTP, open /wp-content/ and create a folder named mu-plugins if it doesn’t exist.
  2. Inside it, create a file named custom-login-gate.php.
  3. Paste the code below, change team-portal to your own slug, and save.
<?php
/**
 * Plugin Name: Custom Login Gate
 * Description: Hides wp-login.php and wp-admin behind a custom login URL.
 * Location:    wp-content/mu-plugins/custom-login-gate.php
 */

defined( 'ABSPATH' ) || exit;

// 1. Change this to your own secret slug (lowercase, numbers, hyphens).
const CLG_LOGIN_SLUG   = 'team-portal';
const CLG_COOKIE_NAME  = 'clg_login_gate';
const CLG_COOKIE_TTL   = 15 * MINUTE_IN_SECONDS;

/**
 * 2. Visiting /team-portal sets a short-lived cookie
 *    and sends the visitor to the real login form.
 */
add_action( 'init', function () {
	$request_path = trim( (string) wp_parse_url( $_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH ), '/' );
	$home_path    = trim( (string) wp_parse_url( home_url(), PHP_URL_PATH ), '/' );
	$gate_path    = trim( $home_path . '/' . CLG_LOGIN_SLUG, '/' );

	if ( $request_path !== $gate_path ) {
		return;
	}

	if ( is_user_logged_in() ) {
		wp_safe_redirect( admin_url() );
		exit;
	}

	setcookie( CLG_COOKIE_NAME, '1', time() + CLG_COOKIE_TTL, '/', COOKIE_DOMAIN, is_ssl(), true );
	wp_safe_redirect( site_url( 'wp-login.php', 'login' ) );
	exit;
}, 1 );

/**
 * 3. Block direct access to wp-login.php unless the gate cookie is present.
 *    Logged-out visits to /wp-admin also land here, so they get blocked too.
 */
add_action( 'login_init', function () {
	$action = isset( $_REQUEST['action'] ) ? sanitize_key( wp_unslash( $_REQUEST['action'] ) ) : 'login';

	// Keep these flows working: logout, reset links from email, protected posts.
	$always_allowed = array( 'logout', 'postpass', 'rp', 'resetpass', 'confirmaction' );
	if ( in_array( $action, $always_allowed, true ) ) {
		return;
	}

	if ( empty( $_COOKIE[ CLG_COOKIE_NAME ] ) ) {
		nocache_headers();
		wp_die( esc_html__( 'Page not found.' ), '', array( 'response' => 404 ) );
	}
} );

Now test it in a private window: /team-portal should open the login form, and /wp-login.php and /wp-admin should return 404. To undo the change at any time, delete or rename custom-login-gate.php.

Why this approach is safer than most snippets:

  • It never touches admin-ajax.php or the REST API, so front-end features keep working.
  • Password reset links from email (action=rp) still work even on a device without the cookie.
  • It works on subdirectory installs because it compares the request against your home path.
  • It adds no rewrite rules, so you never need to flush permalinks or worry about .htaccess conflicts.

One limitation: if your session expires while you’re in the dashboard and the cookie has also expired, WordPress’s pop-up re-login may show “Page not found”. Just visit your custom slug again to refresh the cookie.

Method 2: Configure login URL restrictions

Two quick extras tighten things further. First, stop WordPress from leaking the login address through its convenience redirects. By default, /login, /admin and /dashboard forward visitors to the login page. Add this to the same mu-plugin:

// Stop /login, /admin and /dashboard from redirecting to the login page.
remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );

Second, disable the built-in theme and plugin file editor in wp-config.php. If anyone ever does get into an admin account, this removes the easiest way to inject code from the dashboard:

// wp-config.php, above the line "That's all, stop editing!"
define( 'DISALLOW_FILE_EDIT', true );

Method 3: Apply server-level access controls

PHP rules only run after WordPress loads. Server rules reject unwanted requests before PHP starts, which saves resources and stops attacks even if a plugin has a bug. Use these when you or your team log in from fixed IP addresses, or add a password prompt in front of the login page.

Apache / LiteSpeed: allow only your IP addresses to reach wp-login.php. Add this to the .htaccess file in your WordPress root, outside the # BEGIN WordPress and # END WordPress markers so WordPress never overwrites it. New to this file? Read our WordPress .htaccess guide first.

# Allow wp-login.php only from trusted IPs (Apache 2.4+)
<Files "wp-login.php">
    Require ip 203.0.113.10
    Require ip 198.51.100.0/24
</Files>

Apache / LiteSpeed: restrict the whole wp-admin folder but keep admin-ajax.php public. Create a new .htaccess file inside /wp-admin/:

# /wp-admin/.htaccess
Require ip 203.0.113.10

# Front-end features depend on this file. Keep it reachable.
<Files "admin-ajax.php">
    Require all granted
</Files>

Apache / LiteSpeed: add a password prompt (HTTP Basic Auth) instead of IP rules. This is ideal when your IP changes often. Create the password file outside your public folder:

htpasswd -c /home/youruser/.wpadmin-htpasswd yourname

Then add to the root .htaccess:

<Files "wp-login.php">
    AuthType Basic
    AuthName "Restricted area"
    AuthUserFile /home/youruser/.wpadmin-htpasswd
    Require valid-user
</Files>

# Never serve the password file
<Files ".wpadmin-htpasswd">
    Require all denied
</Files>

The full syntax for these directives is in the .

Nginx: allow only trusted IPs to reach wp-login.php. Add this inside your site’s server { } block. Because Nginx stops at the first matching location, the block must pass PHP to FastCGI itself. Adjust the socket path to your PHP version.

location = /wp-login.php {
    allow 203.0.113.10;
    allow 198.51.100.0/24;
    deny  all;

    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}

Reload Nginx with sudo nginx -t && sudo systemctl reload nginx. See the for more options. On managed hosts that don’t let you edit server config, ask support to add the rule or use the PHP method instead.

Method 4: Test the changes safely

  1. Keep one browser window logged in while you test in another.
  2. Test from a private window and, if you used IP rules, from your phone on mobile data (a different IP).
  3. Submit a contact form or add a product to the cart to confirm admin-ajax.php still works.
  4. Request a password reset to make sure the email link opens the reset form.
  5. If anything fails, rename the mu-plugin file or comment out the new .htaccess lines to roll back instantly.

5. How to Hide the WordPress Admin Bar

The admin bar (also called the toolbar) is the dark strip at the top of the front end for logged-in users. It isn’t a security hole on its own, but hiding it gives subscribers, customers and members a cleaner experience and stops them from seeing links into the dashboard. Note that WordPress never shows the admin bar to logged-out visitors, so there’s nothing to hide for non-logged-in users.

WordPress admin bar before and after hiding itOn the left, a front-end page with the dark WordPress toolbar at the top. On the right, the same page with the toolbar removed for a customer account.Before: toolbar visibleW My Site Customize + New Edit PageAfter: clean front end
Hiding the WP admin bar for customers and subscribers removes dashboard shortcuts and gives your front end a cleaner look.

Hide the admin bar for all users

Without code (per user): go to Users → All Users, edit a user, uncheck Show Toolbar when viewing site, and click Update User. This works for a handful of accounts but not for hundreds of customers.

With code (everyone): add this one line to your mu-plugin or child theme’s functions.php:

// Remove the WordPress admin bar on the front end for every user.
add_filter( 'show_admin_bar', '__return_false' );

Hide the admin bar for specific user roles

With a plugin: Hide Admin Bar Based on User Roles is free and lets you hide the toolbar by role, by capability, or for everyone. It can also keep chosen roles out of wp-admin and send them to a page you pick. Install it, open its settings, tick the roles, and save.

With code: Many tutorials use current_user_can( 'subscriber' ) for this, but current_user_can() is designed for capabilities, not role names, and can behave unpredictably. Check the user’s roles directly instead:

// Hide the admin bar for selected roles only.
add_filter( 'show_admin_bar', function ( $show ) {
	$hide_for_roles = array( 'subscriber', 'customer', 'contributor' );
	$user           = wp_get_current_user();

	if ( array_intersect( $hide_for_roles, (array) $user->roles ) ) {
		return false;
	}
	return $show;
} );

Remove the admin bar using custom PHP code (admins only)

To show the toolbar only to people who can manage the site, base the rule on a capability:

// Show the admin bar only to users who can manage options (administrators).
add_filter( 'show_admin_bar', function ( $show ) {
	return current_user_can( 'manage_options' ) ? $show : false;
} );

Bonus: hide the WordPress dashboard from non-admins

Hiding the toolbar doesn’t stop a customer from typing /wp-admin and seeing the dashboard. To restrict WordPress dashboard access, redirect anyone without editing rights. The wp_doing_ajax() check keeps front-end AJAX working.

// Keep non-editors out of wp-admin and send them to their account page.
add_action( 'admin_init', function () {
	if ( wp_doing_ajax() || current_user_can( 'edit_posts' ) ) {
		return;
	}
	wp_safe_redirect( home_url( '/my-account/' ) );
	exit;
} );

Change /my-account/ to your WooCommerce account page, membership page or homepage. If clutter inside the dashboard is the issue, such as stacks of plugin promo notices, that’s a separate job for an admin-notice manager, not a login-URL tool.

6. Best WordPress Plugins to Hide or Change the Admin Login URL

You only need one of these. Choose a single-purpose plugin if all you want is a new login URL. Choose a suite if you also need 2FA, login limits and a firewall from one place. Running two plugins that both rename the login page is a common cause of redirect loops, so don’t stack them. For a wider comparison, see our review of the best WordPress security plugins.

1. WPS Hide Login

WPS Hide Login is the go-to WordPress admin URL changer. It does one thing, does it well, and adds almost no overhead.

  • Price: Free
  • Active installs: 2+ million, rated 4.8/5 on WordPress.org
  • Highlights: custom login slug, custom redirect for blocked requests, Multisite support with per-site slugs, works with BuddyPress, bbPress, Jetpack and WP Rocket
  • Watch out for: themes or plugins that hardcode wp-login.php links; non-WP Rocket caches need the slug excluded
  • Best for: anyone who just wants to hide the WP admin URL quickly

2. Solid Security (now Kadence Security)

Formerly iThemes Security and then Solid Security, this plugin now appears on WordPress.org as . Its free version includes a Hide Login URL tool among its advanced settings, plus 2FA, password requirements, brute force protection, file change detection and a site scanner.

  • Price: Free; Pro adds passwordless login, trusted devices, Patchstack virtual patching and more
  • Active installs: 700,000+
  • How to use: open Security → Settings → Advanced (labels may vary by version), enable Hide Login URL, enter your slug, and save
  • Best for: site owners who want the login URL, 2FA and brute-force protection managed together

3. All-In-One Security (AIOS)

All-In-One Security by the UpdraftPlus team includes a “Rename login page” feature alongside a firewall with PHP, .htaccess and 6G rules, login lockouts, and free two-factor authentication.

  • Price: Free; Premium adds features like trusted-device periods and emergency 2FA codes
  • Active installs: 1+ million, rated 4.7/5
  • How to use: go to WP Security → Brute force → Rename login page, enable the feature, enter your slug, and save. Recent versions also let you redirect logged-out wp-admin visits to a page you choose.
  • Best for: sites that want a free all-in-one firewall plus a hidden login page

Plugin comparison: features and ease of use

Feature WPS Hide Login Kadence (Solid) Security All-In-One Security
Change login URL ✅ ✅ ✅
Custom redirect for blocked requests ✅ ✅ ✅
Two-factor authentication (free) ❌ ✅ ✅
Limit login attempts ❌ ✅ ✅
Firewall rules ❌ Pro ✅
Multisite support ✅ ✅ ✅
Performance footprint Very light Medium Medium
Setup time ~1 minute ~10 minutes (guided) ~10 minutes
Ease of use ★★★★★ ★★★★☆ ★★★★☆

Our recommendation: Use WPS Hide Login if you already have 2FA and login limits from another source, such as your host. Use AIOS or Kadence Security if you want everything in one plugin, but then use its rename-login feature instead of installing WPS Hide Login as well.

7. How to Test Your Hidden WordPress Admin URL

Don’t assume it works because the settings saved. Run these checks from a private browser window (and ideally a second device) after any change.

Test Expected result If it fails
Open /your-custom-slug Login form loads Re-save permalinks, clear cache, check slug spelling
Open /wp-login.php 404 page or your chosen redirect Purge page cache and CDN; check for a second login plugin
Open /wp-admin logged out 404, not a redirect to the login form Check the plugin’s redirection setting
Open /login and /admin 404 or homepage, not the login form Add the wp_redirect_admin_locations fix above
Log in, then log out Both work; logout lands on login or home page Check menus or themes with hardcoded wp-login.php?action=logout links
Request a password reset Email arrives; link opens the reset form Allow the rp and resetpass actions
Submit a form, add to cart Works normally Make sure admin-ajax.php isn’t blocked

Open the custom login URL

Visit your new slug in a private window. You should see the standard WordPress login form with your site’s branding. Log in to confirm the redirect to the dashboard works.

Test the default wp-login.php address

Still in the private window, visit /wp-login.php. A 404 means it’s hidden. If you still see the login form, a cached copy is probably being served. Purge your cache plugin, your host’s server cache and any CDN, then test again.

Check login, logout, and dashboard access

Log in, open a few admin screens, then log out from the admin bar. Test with a non-admin account too, such as an editor or a WooCommerce customer, to confirm each role lands where you expect.

Test redirects and caching behavior

You can check headers from the command line. A hidden login page should return a 404 status code, not a 200 or a redirect to the login form:

curl -I https://example.com/wp-login.php
# Expect: HTTP/2 404

curl -I https://example.com/team-portal
# Expect: HTTP/2 200 (or a 302 to the login form if you used the mu-plugin)

If you get a 200 on wp-login.php only for logged-out users, your page cache is the culprit. Exclude both wp-login.php and your custom slug from caching.

8. Common WordPress Admin URL Problems and How to Fix Them

Custom login URL is not working

  • A page uses the same slug. If you already have a page at /portal, WordPress may show it instead of the login form. Choose a unique slug.
  • Permalinks are stale. Go to Settings → Permalinks and click Save Changes without changing anything.
  • Cached 404. Your cache may have stored a 404 for the slug before you created it. Purge all caches.
  • Plain permalinks. Some login-URL plugins need pretty permalinks. Switch to “Post name” if you’re still on plain URLs.

Too many redirects

An ERR_TOO_MANY_REDIRECTS error usually means two systems are fighting over the login page. Common causes:

  • Two login-URL tools enabled at once (for example WPS Hide Login and AIOS rename login). Keep one.
  • Mixed HTTP and HTTPS. Make sure WordPress Address and Site Address in Settings → General both use https://.
  • Cookies from an old session. Clear cookies for your domain and try again.

If you can’t reach the dashboard to fix it, rename the plugin folders over SFTP as shown in section 3.

403 Forbidden error

A 403 on the login page or dashboard nearly always comes from server rules, not WordPress.

  • Your IP address changed and no longer matches the Require ip or allow rule. Find your current IP and update the rule.
  • A security plugin’s firewall or lockout has blocked your IP. Wait for the lockout to expire or whitelist yourself from the plugin’s settings.
  • Your host’s firewall (ModSecurity, Imunify360 and similar) flagged the request. Ask support to check the logs.

Cannot access the WordPress dashboard

Work through this in order:

  1. Try your bookmarked custom URL in a private window.
  2. Look up the slug in the database (whl_page) or with WP-CLI.
  3. Rename /wp-content/plugins/wps-hide-login or your security plugin folder.
  4. Rename or delete /wp-content/mu-plugins/custom-login-gate.php if you used the code method.
  5. Comment out any new lines in .htaccess or your Nginx config.

If you see a blank page or a server error instead of a 404, it’s probably a PHP error in your snippet. Our guide to common WordPress errors explains how to enable debug mode and find the exact line.

Plugin conflicts and cache issues

  • Hardcoded login links. Some themes, membership plugins and WooCommerce extensions link straight to wp-login.php. Those links will hit your 404. Update menus and widgets to point at your custom slug, or use the plugin’s own login form shortcode.
  • Caching and CDNs. Exclude wp-login.php, /wp-admin/ and your custom slug from page caching and from CDN “cache everything” rules.
  • XML-RPC. Hiding the login page doesn’t close xmlrpc.php, which also accepts username and password guesses. If you don’t use the Jetpack app or remote publishing, disable XML-RPC through your security plugin.

9. Additional Ways to Secure Your WordPress Admin Area

A hidden login URL is the outer fence. These layers are what actually protect the house. Each one covers a gap the others leave open. Work through them with our full WordPress security checklist.

Defense in depth for the WordPress admin areaConcentric layers protecting the WordPress dashboard: HTTPS on the outside, then firewall and IP rules, hidden login URL, limit login attempts, strong passwords, and two-factor authentication closest to the dashboard.wp-admindashboard1. HTTPS / SSL everywhere2. Firewall + IP restrictions3. Hidden login URL4. Limit login attempts5. Strong, unique passwords6. Two-factor authenticationPlus: updates, backups, least-privilege user roles
Defense in depth: the hidden URL is only one ring. Two-factor authentication and strong passwords protect the dashboard even if the login page is found.

Enable two-factor authentication (2FA)

2FA is the single most effective protection for your WordPress admin login. Even with the right password, an attacker can’t get in without the code from your phone. The WordPress hardening guide recommends it, and you can add it with the free Two Factor plugin or the 2FA modules in AIOS or Kadence Security. Require it for every administrator, editor and shop manager.

Use strong passwords

Use a password manager to generate long, unique passwords for every admin account, and never reuse one from another site. Credential stuffing attacks rely on passwords leaked elsewhere. The is an excellent reference for password policy. While you’re at it, rename any account called admin, since it’s the first username bots try.

Limit login attempts

WordPress allows unlimited login guesses by default. Locking out an IP after a few failures stops brute-force attacks cold, even if someone finds your hidden URL. AIOS and Kadence Security include this, or use a dedicated plugin like Limit Login Attempts Reloaded.

Restrict admin access by IP address

If your team works from fixed IPs or a company VPN, the IP allowlist rules in section 4 are the strongest option of all, because blocked requests never reach WordPress. Remote teams on changing IPs can use HTTP Basic Auth instead.

Keep WordPress updated

Outdated plugins are a far bigger risk than a visible login page. Update WordPress core, themes and plugins promptly, delete anything you don’t use, and buy themes and plugins only from trusted sources. Updates close the holes that attackers actually use, whether or not they can find your login page.

Enable SSL/HTTPS

Without HTTPS, your username, password and login cookie travel in plain text and can be intercepted on public Wi-Fi. Every login page must be served over HTTPS. If your site isn’t there yet, here’s how to install an SSL certificate. Then force HTTPS for the admin area in wp-config.php:

define( 'FORCE_SSL_ADMIN', true );

10. Frequently Asked Questions (FAQs)

How do I hide my WordPress admin URL?

Install the free WPS Hide Login plugin, go to Settings → General, enter a new slug in the “Login url” field, and save. After that, /wp-admin and /wp-login.php show a 404 to logged-out visitors, and only your custom URL loads the login form. Bookmark the new address before you log out.

Can I hide wp-admin without a plugin?

Yes. Add a small must-use plugin in /wp-content/mu-plugins/ that blocks wp-login.php unless the visitor came through your secret slug, as shown in section 4. You can also restrict wp-login.php and /wp-admin by IP address or with a password prompt using .htaccess on Apache and LiteSpeed or a location block on Nginx.

What is the best plugin to hide wp-admin?

WPS Hide Login is the best choice if you only need to change the login URL. It’s free, lightweight and has over 2 million active installs. If you also want 2FA, login limits and a firewall in one place, use the rename-login feature in All-In-One Security or Kadence Security (formerly Solid Security) instead. Don’t run two login-URL tools together.

Can I change the default WordPress login URL?

Yes. WordPress doesn’t have a built-in setting for it, but a plugin or a code snippet can serve the login form at any path you choose, such as /team-portal. Don’t rename the wp-login.php file itself. WordPress core references it in many places, and the next update would restore it anyway.

Does hiding wp-admin prevent brute-force attacks?

It stops most automated brute-force bots, because they only try the default paths. It doesn’t stop a targeted attacker who discovers your custom URL, and it doesn’t protect xmlrpc.php. Combine a hidden login URL with login attempt limits, strong passwords and two-factor authentication for real protection.

How can I recover my WordPress admin URL?

If you used WPS Hide Login, look up the whl_page value in the wp_options table using phpMyAdmin, or run wp option get whl_page with WP-CLI. You can also rename the plugin’s folder in /wp-content/plugins/ over SFTP to deactivate it, which brings back /wp-login.php. If you used custom code, rename or delete the mu-plugin file.

Will hiding the login URL break WooCommerce?

No. WooCommerce customers log in through the My Account page, which is separate from wp-login.php. Just make sure admin-ajax.php stays reachable, and update any menu links that point directly to wp-login.php.

How do I hide the admin bar for non-logged-in users?

You don’t need to. WordPress only shows the admin bar to logged-in users. If logged-out visitors see it, a cached page from a logged-in session is being served. Exclude logged-in users from your page cache and purge it.

11. Conclusion

Hiding your WP admin URL is one of the quickest security wins in WordPress. In a couple of minutes, WPS Hide Login moves your login page to a private address and sends brute-force bots to a dead end. If you’d rather avoid another plugin, the mu-plugin snippet does the same job in a few lines, and server-level IP or password rules block unwanted traffic before WordPress even loads.

Just remember what it is: the outer fence, not the lock. Bookmark your new login URL, test it in a private window, exclude it from caching, and then add the layers that really stop attacks: two-factor authentication, strong passwords, login limits, HTTPS and prompt updates. Do that, and your wp-admin goes from the most-attacked page on your site to one that bots can’t even find.

Run a free WordPress security audit

Inspire us with your love!

Saiful Islam

By Saiful Islam

Saiful Islam, the founder of aThemeArt, is a successful freelancer, a father of two boys, and an enthusiast in coding, YouTube, and gaming. Connect with me on Twitter, Facebook, and Instagram to stay updated with my latest endeavors.

You can check also

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*