Redirect after Login on WordPress
The accepted answer is very wrong. One should never be modifying the WordPress Core. Not only will edits be lost at a given update, some changes you make on a whim may compromise other functionality or even endanger the security of your site.
Action Hooks & Filters are included within the core to allow modifying functionality without modifying code.
An example of using the login_redirect
filter to redirect certain users can be found here and is a much more robust solution to your problem.
For your specific problem, you want to do this:
function login_redirect( $redirect_to, $request, $user ){
return home_url('news.php');
}
add_filter( 'login_redirect', 'login_redirect', 10, 3 );
This should solve your problem. Adapted from an answer found here.
Add the following snippet of code in the functions.php file of your theme:
function admin_default_page() {
return '/new-dashboard-url';
}
add_filter('login_redirect', 'admin_default_page');
You can also use the customized link as:
https://example.com/wp-login.php?redirect_to=https://example.com/news.php