Does anyone know a way (or plugin) that would allow me to automatically redirect users to another page, based on their assigned user role, if they try accessing the main /wp-admin page?
The tricky part is (I guess), is that I still need them to be able to access sub-admin pages (ie. mysite.com/wp-admin/edit.php) — it would only redirect them if they tried going to the main/dashboard page, mysite.com/wp-admin
I’ve recently had the problem where I needed to redirect multiple pages. The following code will check the roles you want to redirect ($valid-roles) and if not valid redirect to a given URL… in this case its /access-denied/.
Note: The page ID’s in the array list of pages to re-direct.
There are many ways you can set the URL redirect to a different link by role on your WordPress page, you may use a plugin or you can also build a plugin to customize it specifically on your own way follow this link for that instruction but I believe as a second and better option this plugin right here might be easy for you might help you as well.
Good luck