Redirect Logged-in Users from User Login Page to My Account

Snippet Description

This snippet ensures that when users log in with Nextend Social Login (or any other login method) and get redirected to the custom login page (/user-login), they are immediately forwarded to the WooCommerce My Account page (/my-account) or your own custom account page.

It prevents logged-in users from unnecessarily staying on the login page.

Usage Instructions

  1. Install and activate the Code Snippets plugin (or paste into your theme’s functions.php).

  2. Add a new snippet and paste the code below.

  3. Save and activate.

  4. After login, any user who lands on /user-login while already logged in will be automatically redirected to /my-account.

Table of Contents