Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Hide the WordPress Login Page (wp-admin)

Move your login address from /wp-admin to your own address, so bots cannot find it so easily.

WordPress2 min read6 steps5 screenshots

Why hide wp-admin

  1. Fewer brute-force attacks. Bots try thousands of passwords on /wp-login.php.
  2. Less noise from bots.
  3. Lower server load from failed login attempts.

Hiding the login page is one layer of defense. It does not replace strong passwords and updates.

Method 1: Use a plugin

Plugins such as WPS Hide Login or the login URL feature of iThemes Security (now Solid Security) are the safest and easiest way.

With WPS Hide Login

  1. Go to Plugins, then Add New. Search for WPS Hide Login, install and activate it.
    Installing WPS Hide Login
  2. Go to Settings, then WPS Hide Login. Type a new login address, for example my-secret-login, and click Save Changes.
    Setting the new login URL
  3. Your login page is now at https://example.com/my-secret-login. Save the address in a safe place.

Method 2: Use .htaccess

On Apache you can rewrite a custom address to the login file. Make a backup of .htaccess first. Example:

RewriteRule ^new-login$ /wp-login.php?new-login=1 [L,QSA]
The rewrite rule in .htaccess

This rule alone does not block direct access to /wp-login.php. Add a rule that blocks wp-login.php for visitors who do not use the secret query, or use a plugin instead.

Method 3: Use wp-config.php

You can change cookie names and keys in wp-config.php, and force SSL for logins:

The wp-config.php file
define('AUTH_COOKIE', 'your_custom_cookie_name');
define('LOGGED_IN_COOKIE', 'your_custom_cookie_name');
define('SECURE_AUTH_COOKIE', true);
define('FORCE_SSL_ADMIN', true);
The custom definitions

Use new random values for the security keys (AUTH_KEY and the others). You can make them with the WordPress secret-key service.

Method 4: Rename the admin folder

This is not advised. If you rename wp-admin, you must replace all mentions of it in the files and the database, and update the keys in wp-config.php. A WordPress update will bring the folder back.

Best practices

  • Keep WordPress, themes and plugins updated.
  • Use strong passwords and a password manager.
  • Turn on two-factor authentication.
  • Limit login attempts.
  • Back up your site on a regular basis.
Warning: Write down your new login address. If you forget it, rename the plugin folder with FTP to get back the normal login.

Quick recap

  • A login URL plugin is the easiest way.
  • Combine it with 2FA and login limits.
  • Keep a note of the new address.