How to redirect if user has specific role in wordpress

  • home
  • /
  • WordPress
  • /
  • How to redirect if user has specific role in wordpress

I created one simple function when you require redirect of specific role (Administrator,Subscriber,Contributor,Author,Editor) in wordpress

Place below snipped to your theme’s functions.php. It will redirect any users with the user role of ‘subscriber’ to your chosen url.

 

  • Share:

Leave a Comment

sing in to post your comment or sign-up if you dont have any account.

4 × 5 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.