You might be tempted to do it manually and not use a plugin for this but I strongly recommend doing it with a plugin. The reason being is that when WordPress updates your manual solution will most likely result in loss. Modifying core functions is generally not a good idea and can be difficult for a novice PHP user. Also changing that can cause issue when logging out and other functionality issues. For those reasons I recommend that you use a plugin for that.
Having said all of that the following solution is extracted from here:
https://wordpress.org/support/topic/how-to-change-the-admin-url-or-wp-admin-to-secure-login/
- Add constant to wp-config.php
define('WP_ADMIN_DIR', 'secret-folder');
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);
- Add below filter to functions.php
add_filter('site_url', 'wpadmin_filter', 10, 3);
function wpadmin_filter( $url, $path, $orig_scheme ) {
$old = array( "/(wp-admin)/");
$admin_dir = WP_ADMIN_DIR;
$new = array($admin_dir);
return preg_replace( $old, $new, $url, 1);
}
- Add below line to .htaccess file
RewriteRule ^secret-folder/(.*) wp-admin/$1?%{QUERY_STRING} [L]
Now your admin URL will be like: http://www.YOUR-SITE.com/secret-folder/