WooCommerce: Set Default Dashboard Login Page to “Products”

When you log in to the WordPress dashboard and WooCommerce is active, you might want to be redirected to a different page rather than the default “Dashboard” one.

For example, you might want to go directly to the “Products” admin page, or maybe to the “WooCommerce > Orders” page. Or, if you are like me on my development website, you want to go straight to the WordPress editor’s functions.php file ๐Ÿ˜€

Either way, saving time on login is what we’re chasing here. Pick your default login page, and then use the two snippets below to target actual logins and direct accesses to wp-admin. Enjoy!

Redirecting dashboard logins to the WooCommerce “Products” admin page

Snippet (PHP): Redirect Dashboard Login to “Products” Page @ WordPress/WooCommerce Admin


/**
 * @snippet       Default Dashboard Page @ WP Admin
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=108166
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.5.4
 * @community     https://businessbloomer.com/club/
 */ 

add_action( 'load-index.php', 'bbloomer_direct_access_wp_dashboard_redirect' );

function bbloomer_direct_access_wp_dashboard_redirect(){
	wp_redirect( admin_url( 'edit.php?post_type=product' ) );
}

add_filter( 'login_redirect', 'bbloomer_login_wp_dashboard_redirect', 9999, 3 );

function bbloomer_login_wp_dashboard_redirect( $redirect_to, $request, $user ){
	$redirect_to = admin_url( 'edit.php?post_type=product' );
	return $redirect_to;
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Add Second Description @ Product Category Pages
    In terms of SEO, if you’re trying to rank your product category pages, you really need to make the most of the default WooCommerce product category “description” and “thumbnail”. Most themes, if compatible with WooCommerce, will show this content right below the product category name and above products. Nothing new so far. But what if […]
  • WooCommerce: Add Column to Orders Table @ WP Dashboard
    The WooCommerce Orders Table, which can be found under WP Dashboard > WooCommerce > Orders, provides us with 7 default columns: Order – Date – Status – Billing – Ship to – Total – Actions. This is used by shop managers to have an overview of all orders, before eventually clicking on a specific one. […]
  • WooCommerce: Hide/Show The WP Admin Bar
    In previous WooCommerce versions, new customers could access the WP Admin black bar after purchase. Now this seems fixed. Still, what about other user roles, and what if you want to override this default behavior? Well, here’s a quick snippet for you – feel free to use it in your own WooCommerce site. Enjoy!
  • WooCommerce: Display Custom Filters @ WP Dashboard > Products
    If you go to WordPress Dashboard > Products you will find default product admin filters such as “Select a category”, “Filter by product type”, “Filter by stock status”. What if you want to add more custom filters to let your shop managers find products easily? For example, you could add “Filter by product tag” (“product […]
  • WooCommerce: View Thank You Page @ Order Admin
    I’ve been testing for over an hour but finally I found a way to make this work. When you are in “Edit Order” view under WordPress Dashboard > WooCommerce > Orders, there is a dropdown of “Order actions”: “Email invoice”, “Resend new order notification”, etc. A major problem I’ve always had while troubleshooting or working […]

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

10 thoughts on “WooCommerce: Set Default Dashboard Login Page to “Products”

  1. Hello Rodolfo Melogli, you’re Gem man!! love your coding and your techniques. It helps me a lot to become a good wp developer ๐Ÿ™‚

    1. Great!

  2. Hi,

    Very good article BUT if i like to redirect to Dashboard Order Page ONLY the Shop Manager Users

    Regards,
    Pete

    1. Hey Pete, thanks so much for your comment! Yes, this is possible – unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  3. Great post! Please confirm how to modify the code to set the Default Dashboard Login Page to other pages, like orders. I’m thinking we simply change the post_type=, such as orders is “shop_order”
    Thank you.

    1. Ken, thanks for your comment! Just get the URL of the page you want to set from the browser itself, and then enter it inside the snippet ๐Ÿ™‚

  4. This is so simple and very useful. Thank you Rodolfo ๐Ÿ™‚

    1. Awesome!

  5. This is so convenient. Thanks for the code ๐Ÿ™‚
    How can I make them redirect to their current page? For both login and register pages?

    Example. I am browsing a product and i want to loging/register to buy it, and after be directed to same page i was looking at?

    1. Hey Richard, thanks for your comment! This is to redirect the website admin, not the customers ๐Ÿ™‚

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *