Redirect After Login on Wordpress

Redirect after Login on WordPress

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');

Redirect to page after login, when you came from specific page in wordpress

If you want custom redirection, you can use like this

$returnPath = get_settings('siteurl') . '/login/?redirect_to=' . urlencode($_SERVER['REQUEST_URI']);

<a href="<?php echo $returnPath;?>">Login link</a>

WordPress redirect specific user after login

If you are sure about permission, remove last slash and try again.

return home_url("/wp-admin/edit.php?post_type=shop_order");


Related Topics



Leave a reply



Submit