Try something like this:
add_action( 'wp_login','redirect_to_homepage');
function redirect_to_homepage() {
// if user is accessing admin page/dashboard do not redirect
if (is_admin()) {
return;
}
wp_redirect( get_home_url());
exit;
}
Edited to add optional line that does not redirect if user is accessing the Dashboard.
Related Posts:
- Auto Redirect after login
- How to write RewriteRule for login in multisite
- Multisite: Redirect Subsite Administrator to Subsite Home Page, Bypassing Dashboard
- Admin user getting redirected to /wp-admin/user
- Redirect Main Site to Subsite in Multisite WordPress
- Is there a is_user_logged_in() for multisite?
- Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
- How to disable Multisite sign-up page?
- Unable to login to new custom domain on multisite?
- WordPress multisite,several different languages,page redirect?
- WordPress Multisite – Multiple subfolders for blogs
- Multisite 404 errors and non-www redirecting to home page
- share login/logout sessions across two installs?
- How to Login Once to an Entire WP Multisite Network
- Redirect all users, except network administrators, from the main site to a subsite
- Multisite wp-admin redirect loop
- Multisite non-www domain redirects to sign-up
- WordPress network (multisite) /wp-admin/ redirect loop (ERR_TOO_MANY_REDIRECTS)
- Domain redirect in WordPress multisite
- 301 Redirects for posts, category, pages from original domain to sub-domain of multisite
- Trying to access second site dashboard on a multisite configuration proceeds to an error
- Why wordpress multisite redirect to wp-signup if site exists?
- Multisite network admin – URL / redirect error
- WordPress Multisite local: wp-login.php refreshes on login Chrome Browser
- WordPress multisite subdirectory on nginx behind reverse proxy
- How to stay logged in on a multisite with different domains?
- Disable domain redirect
- Redirect users on logout
- Login on Multiple Sub-Domains without Multisite
- WPMU Development Environment
- Redirect subdomain in Multisite installation?
- Issue with htaccess redirection in WP Multisite
- WordPress MultiSite login to the respective site
- Multsite redirecting to the main site
- Multisite setup help – plain domain/subsite always redirects to domain with subdir multisite
- Temp URL Redirect Loop
- Wrong Redirect/Rewrite Rules?
- Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
- How to fix blocked cookies error that doesn’t let me log into wp-admin?
- WordPress Multi-Site on Ubuntu 18.04 LAMP Keeps Re-Directing
- URL without www redirect directly with submission page – Multiwordpress install
- Nginx config, how can I redirect primary multisite domain, but not its sub-folders, nor other domains?
- WordPress Multisite + Erros with URLS and ADMIN
- Redirect old uploads after moving to multisite
- 301’s not working with multisite
- Automatically login user across multisite
- Multisite, Subdomain, shared NFS directory Linux HELP
- How to split existing blog into WordPress Multisites without breaking links?
- Multisite Subdomain Redirect Mask
- Network Admin URL is shown to anyone before accessing a blog
- Cannot use Network Admin (Dashboard) on Multi-site after 301 www redirect
- 404 redirecting to home [closed]
- Multisite Login problem
- Https and Http Login Issue on WordPress Multisite
- 301 Redirection After Comment
- Different Domains in Multisite Setup
- Multisite infinite redirect loop
- Multisite Redirect for Home Page Only
- Disable site visiting and user logins excepting for a specific user
- How to redirect user after session timeout
- Is there something I need to know in order to use WordPress on foreign (Swedish) TLDs?
- Restrict users of site 1 to login in site 2 in wordpress multisite
- Unable to execute Ajax request, status code 400
- Redirect a WordPress Multisite url after it has been change to a new one
- Redirecting specific sites to HTTP in WordPress Multisite
- Redirect Function Prevents Images from Showing in Front-end Media Uploader
- Moving from a non WordPress site to a WordPress Site – Login between both sites
- multisite 404 subfolder same name slug as site
- How to make the redirects right? IP to domain name folders
- Multisite network admin login redirect
- WordPress Multisite: Login to all subsites at once
- WordPress multisite redirect one custom non www domain to www
- Unable to sign in to network after moveing address but able to login into child sites
- Single sign on to sub-sites in Multisite Network
- how to make a cronjob run, when user needs to be logged in
- Multisite WordPress Configurtion
- How do I point two urls to the same child site in a multisite config
- Redirecting two Multisite domains to Single site on different host
- All Subsites of a WordPress Multisite install 302 redirects to the main site
- Multisite install in a subfolder won’t work with www
- Multisite login and redirect to users main blog,
- Redirect all users, except network administrators, from the main site to a subsite
- Make a select where the options are the different multisites
- How to redirect author subdomain pages to each author pages on www
- Redirect extra url to Multisite in folder
- Multisite move server giving redirect loop
- Pages redirect me to the homepage
- How do I combine wp_redirect and add_filter?
- Multisite redirect loop for a single www domain
- Development (multi)site indexed – recommendations to redirect 301 to correct url?
- Redirect authors from upload.php url to Home page in Multisite
- Nginx Multisite redirects (incorrectly) on Chrome IE and Mobile, but works (correctly) on Firefox
- Common login for websites belonging in different networks
- How to redirect root blog to a specific one in multilang WP?
- Nice font not working when http to https – SSL Issue
- Best Way to Setup a Network of WP Sites?
- External rewrite rules missing in htaccess – Multisite
- Multisite Primary Domain Broken All Subsites Work
- Make multisite non-existing subdomains go to homepage instead of Index of/ page
- WordPress MU: Cookie error when trying to login on network WP instance