DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for Redirect user to homepage after login/logout in WordPress
Chris Texe
Chris Texe

Posted on • Updated on • Originally published at madlon.eu

Redirect user to homepage after login/logout in WordPress

Let’s assume you have a WooCommerce shop in multisite WordPress installation. When user will logout then is redirected to main website from your multisite. User should be redirected to homepage of your store. If you want to redirect user to homepage after login or logout in WordPress put this code in functins.php file:

After saving the file user after logout will be redirected to homepage.

Top comments (0)

πŸ‘‹ Haven't Posted on DEV Yet?

Head over to our Welcome Thread and tell us a bit about yourself!