1. Backup Your Website
Before making any changes, backup your WordPress site. This ensures you can restore your site if anything goes wrong.
- Use a plugin like UpdraftPlus or All-in-One WP Migration.
- Alternatively, back up your site manually by downloading all files via FTP and exporting the database through phpMyAdmin.
2. Use a Plugin to Change the Admin URL
The easiest and most user-friendly method is to use a plugin.
Recommended Plugins:
- WPS Hide Login
- iThemes Security
- All In One WP Security & Firewall
Steps with WPS Hide Login:
- Install and Activate:
- Go to Plugins > Add New.
- Search for WPS Hide Login.
- Install and activate it.
- Change Admin URL:
- Go to Settings > General.
- Scroll down to find the “WPS Hide Login” section.
- Enter your desired admin URL in the text field (e.g.,
/new-login-url). - Save changes.
- Access New Admin URL:
- Your old admin URL (
yoursite.com/wp-adminoryoursite.com/wp-login.php) will no longer work. - Use the new URL to log in (e.g.,
yoursite.com/new-login-url).
3. Change the Admin URL Manually (Advanced Users)
If you prefer not to use a plugin, you can change the admin URL manually. This method involves modifying the .htaccess file or adding custom code. Proceed with caution.
Method 1: Modify .htaccess
- Access your site via FTP or your hosting control panel’s file manager.
- Locate the
.htaccessfile in the root directory of your WordPress installation. - Add the following code to redirect
wp-login.phpto a new custom URL:
apache
Copy code
# BEGIN Protect wp-login
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/wp-login.php$
RewriteRule ^(.*)$ /custom-login-url [R=301,L]
# END Protect wp-login
- Replace
/custom-login-urlwith your desired admin URL. - Save the file and test the new URL.