Reputation: 333
Is there a way to remove & redirect any users of a site from accessing
https://www.example.com/wp-admin/
Unless there id is one, i have seen some examples floating around the ask if admin-ajax is being used if so redirect. how ever this is not approach i wish to make as im using admin ajax on the front end for some admins. i just don't wish them to see anything to do with the backend of wordpress.
Only userid 1 should have access to wp-admin.
Upvotes: 0
Views: 476
Reputation: 447
Maybe WP-Cerber will serve your needs? https://wordpress.org/plugins/wp-cerber/
Checkout the part: "You can hide WordPress dashboard (/wp-admin/) when a user isn’t logged in. If a user isn’t logged in and they attempt to access the dashboard by requesting /wp-admin/, WP Cerber will return a 404 Error."
It also has the option to create a custom url for /wp-login.php (usually an address that is targeted by bots).
If you want to do it without a plugin you can use htaccess RewriteRule: https://wordpress.stackexchange.com/questions/4037/how-to-redirect-rewrite-all-wp-login-requests
Upvotes: 0