➡️ Redirect Users to Custom Login Page After Logout
Snippet Description
This snippet ensures that whenever a user logs out of WordPress, they are redirected to a custom login page (/user-login) instead of the default WordPress login screen. It provides a seamless user experience for membership, community, or client portals where you want users to re-login from a branded page.
Usage Instructions
-
Copy the code snippet.
-
Add it to your site using the Code Snippets plugin or directly in your theme’s
functions.phpfile. -
Update the redirect URL (
/user-login) to match your custom login page slug if different. -
Save changes and log out to test the redirect.