Steps to Change the Admin URL in WordPress

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:

  1. WPS Hide Login
  2. iThemes Security
  3. All In One WP Security & Firewall

Steps with WPS Hide Login:

  1. Install and Activate:
  • Go to Plugins > Add New.
  • Search for WPS Hide Login.
  • Install and activate it.
  1. 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.
  1. Access New Admin URL:
  • Your old admin URL (yoursite.com/wp-admin or yoursite.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

  1. Access your site via FTP or your hosting control panel’s file manager.
  2. Locate the .htaccess file in the root directory of your WordPress installation.
  3. Add the following code to redirect wp-login.php to 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
  1. Replace /custom-login-url with your desired admin URL.
  2. Save the file and test the new URL.

Leave a comment

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