How To Hide WordPress Admin URL

In last post we shared the trick to hide WordPress login URL using .htaccess file. This tutorial is bit different from the previous tutorial. In last tutorial we just redirected /login to /wp-login.php, but now we will change the WordPress admin URL /wp-admin/ to /admin-panel/. It’s not the redirection, we’ll completely change the default admin slug to admin-panel.

This is a must use trick if you’re working on a client website. In this way, it’d hard for people to identify if it’s a WordPress site. We can also restrict the access to /wp-admin/ URL. Let’s get started with the first stuff:

Hide WordPress Admin URL

[alert style=”red”]According to user feedback, this snippet doesn’t work anymore. Only use it if you know what you’re doing.[/alert]

Add following snippet to your WordPress’ wp-config.php file:

Now, add following snippet to your current theme’s functions.php file:

Finally, add following snippet to your .htaccess file:

Now your admin URL will be like:

Restrict wp-admin URLs:

The following code will redirect all /wp-admin/ URL requests to your 404.php error page. Add it on your theme’s functions.php file: