Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress disable /admin redirect to /wp-admin

Tags:

php

wordpress

I have my website built with wordpress 4.5.2.

For wordpress contro panel, it it normal to login with myweb.com/wp-admin directory. But I have another control panel with other application in the directory myweb.com/admin.

The problem is whenever I try to login to myweb.com/admin it redirects to myweb.com/wp-admin

How to disable it?

like image 348
Priyamanu Avatar asked Apr 08 '26 14:04

Priyamanu


1 Answers

You should cancel the default shortcuts in function.php :

remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );

From the docs:

wp_redirect_admin_locations():

If a user visits example.com/admin, they’ll be redirected to /wp-admin. Visiting /login redirects to /wp-login.php, and so on.

like image 107
Pierre Avatar answered Apr 10 '26 02:04

Pierre



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!