Redirect User To Specific Page Based On Their Capability After Logging In

This PHP code redirects any user who isn’t capable of updating the core (Only admins) to a specific url on your site.

The PHP code includes the current_user_can() and wp_redirect() functions with the admin_init hook which fires before any other hook when any user logs into any wp_admin page.

You could also use the login_redirect filter.

The code above comes from the WordPress Codex and will need modifying to work.

Similar Posts

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.