Filter 'login_redirect'.
Sample code, not tested:
add_filter( 'wp_login', 'wpse_78150_login_redirect' );
function wpse_78150_login_redirect( $url )
{
# uncomment the next line for debugging
# var_dump( wp_get_current_user() ); exit;
if ( ! current_user_can( 'custom_role' ) )
return $url;
return admin_url();
}
Related Posts:
- How to check if a user is in a specific role?
- Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
- How to prevent access to wp-admin for certain user roles?
- Check if user is admin by user ID
- Change Login URL Without Plugin
- Only allow administrators and editors to access wp-admin
- create users to site with specific language
- Prevent from deleting any user role but subscriber
- What is the capability that permits access to WP-Admin?
- Displaying which Role the current user is assigned to
- How to hide a specific user role option in a user role list?
- Adding HTML/Text to Top of Subscriber’s Profile Backend Page
- Replace wordpress login logo with custom text
- Using /wp-admin works, using /login gives a 404. Why?
- Custom role based users are not able to access wp-admin
- Custom roles showing HTML entities in title form field
- Users Unable to Access Dashboard/Posts/Pages
- Only allow administrators and editors to access wp-admin
- FORCE_SSL_ADMIN not working
- Allow administrators to pick post author on custom post type edit screen
- Adding Custom Capabilites
- Restrict Author role to only 3 wp-admin pages
- Use Password Protected Form without the use of wp-login.php
- wp-admin – 404 after custom login form
- Why is unfiltered_upload not working despite being enabled?
- How to fix ‘WordPress redirection loop problem in wp-login.php page’?
- Logout USER form backoffice after 30 minutes of inactivity [closed]
- WordPress server change – slow admin login time for first time
- White screen of death for wp-admin and error for wp-login.php after entering credentials
- Blank page for wp-admin after i uploaded the website from my localhost to the live server
- Downgrade admin account by mistake
- Why can I log into wp-login.php and not wp-admin.php?
- Disable Admin CP authentication (or auto login)
- User Capabilities are not available in WP REST permission callback?
- Change users.php WP_User_Query
- User Roles: How to hide a plugin from showing in WP-Admin?
- Is WordPress secure enough for a multi-user article directory?
- Newly created user role not displaying on users screen
- When i try to open Localhost/wordpress/wp-admin . An Error appears ” Registration Has been Disabled” . No login page is shown in the browser
- How to check if a user is in a specific role?
- Give wp-admin access for shop managers
- adding existing menu page on new customer user role
- Launch wordpress site to local computer from live website backed-up
- Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the “users search” input box
- Custom login form logo not displaying
- how to Hide all products except the General Manager role in the WordPress admin panel?
- WordPress site shows a white page for site/wp_admin. A login returns again to the login screen
- Unable to login or reset password via wp-admin
- login_enqueue_scripts changes are not reflecting
- adding the category to the admin column for a custom post type?
- Change page title in admin area
- How to filter by post-format in admin?
- Make fonts.com font work in TinyMCE (iframe referrer issue)
- Securing wp-admin folder – Purpose? Importance?
- Opening specific posts on WP takes lot of time and freezes the editor
- How to load a CSS file into WordPress admin area using Child Theme? [closed]
- Getting “Cannot modify header information – headers already sent” error, but only on backend
- Cookie value cannot be read until I’ve logged into the WP admin
- How to inhibit dashboard and profile management access to normal users?
- What corrections does this code need?
- How to add wordpress blog to Windows 2008 R2 site
- WordPress disable ‘Install Themes’ tab
- WordPress Admin Not Loading All Core Scripts
- The uploaded file exceeds!
- Admin table list API?
- How to change user admin_color with WP CLI?
- WP Admin/ WP Login Redirect to themselves
- Unable to log in to localhost wp-admin page on XAMPP server
- Missing ‘Move to Trash’ option from bulk select box
- post-new.php?post_type=product is not loading properly
- Renaming wp-admin without hard-coding it. Is it really possible?
- Change admin defaults for reading settings
- How to hide Admin Tabs? [duplicate]
- Admin login not working
- Restrict admin access to certain pages based on page slug
- Available resources for learning WordPress 4.7.2 from the ground up?
- Create new user from phpMyAdmin
- how to stop wordpress admin menu from scrolling with page
- How to have WP admin in English while public website is in another language?
- How to access wp-admin from original website after setting the domain redirect/forwarding
- Remove “Filter” Button on All Posts in wp-admin
- Unable to login after registration
- How can I fix, Sorry, you are not allowed to access this page. I have tried the usual
- only last option from theme options is being saved to the DB
- wp-login.php entering password nothing happens
- Cached php? Updates are rendering only if logged as admin
- Symlinking WordPress WP-ADMIN and WP-INCLUDES
- I cannot access my WP website after changing settings
- Making WP Admin Folder accessable JUST under a different link
- Is it possible to load an admin page inside a thickbox?
- Why would running an admin check throw a 500 error? I’m calling is_super_admin();
- I am not able to enable jQuery in theme settings
- WordPress loop in post admin view
- How to restrict user to see his comments only and admin can see everyone comments?
- theme injecting css into wp-admin
- Redirection to external site on admin
- WP-Admin not reachable
- How Can I Prevent Admin User Role Loss?
- Only Admin receives email
- Admin utility classes?