This question already has an answer here:
I like to change the wordpress wp-admin URL to something else to save my site from bruteforce attacks.
Most important thing is that i like to build this without plugin.
So, if anyone have any idea then do lemme know.
I applied changes as per the below links: https://w3reign.com/how-to-change-wp-admin-url-in-wordpress-without-plugin/
but it's working but when i fire the http://site_url/admin_url it's showing wp-login.php.
So, how can i do so ?
</div>
Hope it helps. For detail, use this
I have never try that before but i found this
Add this code to wp-config.php
define( 'WP_ADMIN_DIR', 'private-area' );
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR );
and add this code to your function.php
add_filter( 'site_url', 'change_wpadmin_url', 10, 3 );
function change_wpadmin_url( $url, $path, $orig_scheme ) {
$old = array( "/(wp-admin)/" );
$admin_dir = WP_ADMIN_DIR;
$new = array($admin_dir);
return preg_replace( $old, $new, $url, 1 );
}
And finally add this code to htaccess file
RewriteRule ^private-area/(.*) wp-admin/$1?%{QUERY_STRING} [L]
Hope this will help you.