Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Multisite login and redirect to users main blog,

I solved this and I only use:

wp_login_form();

Since I don’t want users to get access to the wp-admin area at all I use the following code:

// Restrict users from accessing the admin-area
function restrict_admin()
{
    if ( ! current_user_can( 'manage_sites' ) ) {
        wp_redirect( site_url() );
    }
}
add_action( 'admin_init', 'restrict_admin', 1 );

// Disable admin-bar for users
add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
    if (!current_user_can('manage_sites') && !is_admin()) {
        show_admin_bar(false);
    }
}

Kind regards
Johan

Related Posts:

  1. Redirect Main Site to Subsite in Multisite WordPress
  2. Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
  3. How to disable Multisite sign-up page?
  4. WordPress multisite,several different languages,page redirect?
  5. WordPress Multisite – Multiple subfolders for blogs
  6. WordPress multisite subdirectory redirect infinite loop issue
  7. Multisite 404 errors and non-www redirecting to home page
  8. multisite htaccess 301 redirects
  9. W3 Total Cache Plugin with WP 3 MultiUser [closed]
  10. Redirect all users, except network administrators, from the main site to a subsite
  11. Multisite wp-admin redirect loop
  12. Multisite non-www domain redirects to sign-up
  13. WordPress network (multisite) /wp-admin/ redirect loop (ERR_TOO_MANY_REDIRECTS)
  14. Domain redirect in WordPress multisite
  15. Multisite – Redirect All Users to Subsite Home Page on Subsite Login
  16. Multisite non www domain gives registration error but should redirect to www.domain.com
  17. 301 Redirects for posts, category, pages from original domain to sub-domain of multisite
  18. Trying to access second site dashboard on a multisite configuration proceeds to an error
  19. Redirect loop (only for multisite network admin)
  20. Why wordpress multisite redirect to wp-signup if site exists?
  21. Sub-subdomain getting redirected to main domain
  22. Multisite network admin – URL / redirect error
  23. How to exclude a directory from WordPress permalinks in a Multisite environment?
  24. Redirect subdomain homepage to domain specific page in wordpress multisite
  25. WordPress multisite subdirectory on nginx behind reverse proxy
  26. Multisite Redirect issue
  27. How to Redirect login User with Mapped Domiain Primary blog Url to Original Sub-site Url
  28. Disable domain redirect
  29. Redirect users on logout
  30. Multisite, multiple domains per site
  31. Multisite Network menu links not updating
  32. How to disable the default WordPress redirect to non-www URLs?
  33. https redirect hell (adding www)
  34. Auto Redirect after login
  35. WPMU Development Environment
  36. Redirect subdomain in Multisite installation?
  37. Issue with htaccess redirection in WP Multisite
  38. Site kit Google Analytics setup giving Error: {“error”:”invalid ‘redirect_uri'”}
  39. All pages have 302 redirect, which I can’t remove
  40. Why my deleted url is redirecting to random post?
  41. Redirect only posts to New Domain
  42. Multsite redirecting to the main site
  43. Multisite setup help – plain domain/subsite always redirects to domain with subdir multisite
  44. Redirect & permalink problems after moving multisite to a new server
  45. Temp URL Redirect Loop
  46. Installed domain-based Multisite but can’t access wp-admin (redirect loop)
  47. Redirect Site Geologically
  48. How to configure Multisite Network with randomized hostnames?
  49. WordPress Multisite Strange Redirect on Primary Site
  50. Wrong Redirect/Rewrite Rules?
  51. Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
  52. WordPress Multi-Site on Ubuntu 18.04 LAMP Keeps Re-Directing
  53. URL without www redirect directly with submission page – Multiwordpress install
  54. Multisite Redirection to new domains
  55. Nginx config, how can I redirect primary multisite domain, but not its sub-folders, nor other domains?
  56. Redirect One Multisite to Another
  57. Site redirecting to http://example.com/wp-signup.php?new=example.com
  58. WordPress Multisite + Erros with URLS and ADMIN
  59. Redirect old uploads after moving to multisite
  60. 301’s not working with multisite
  61. Multisite, Subdomain, shared NFS directory Linux HELP
  62. WordPress: how to change URL for individual MultiSites?
  63. How to split existing blog into WordPress Multisites without breaking links?
  64. How to write RewriteRule for login in multisite
  65. Multisite Subdomain Redirect Mask
  66. Network Admin URL is shown to anyone before accessing a blog
  67. Cannot use Network Admin (Dashboard) on Multi-site after 301 www redirect
  68. 404 redirecting to home [closed]
  69. How to temporarily redirect front page of a network to one of the sites/blogs?
  70. 301 Redirection After Comment
  71. Multisite Redirect for Home Page Only
  72. Working with Reverse Proxies and Multisite Installation
  73. How to redirect user after session timeout
  74. How to Force WWW. in Domain With WordPress MU Domain Mapping Plugin?
  75. Two installs conflicting – Pages redirecting
  76. Redirect a WordPress Multisite url after it has been change to a new one
  77. Redirecting specific sites to HTTP in WordPress Multisite
  78. Redirect Function Prevents Images from Showing in Front-end Media Uploader
  79. multisite 404 subfolder same name slug as site
  80. After switch domain, some parts of my site still point to my old domain
  81. How to make the redirects right? IP to domain name folders
  82. Multisite network admin login redirect
  83. Multisite wp-admin redirecting to main wp-admin using NGINX
  84. WordPress multisite redirect one custom non www domain to www
  85. Multisite (with nested paths) wp-admin redirect loop
  86. Multisite WordPress Configurtion
  87. How do I point two urls to the same child site in a multisite config
  88. Redirecting two Multisite domains to Single site on different host
  89. All Subsites of a WordPress Multisite install 302 redirects to the main site
  90. Multisite install in a subfolder won’t work with www
  91. WordPress Multisite redirect loop
  92. Redirect all users, except network administrators, from the main site to a subsite
  93. Multisite: Redirect Subsite Administrator to Subsite Home Page, Bypassing Dashboard
  94. Admin user getting redirected to /wp-admin/user
  95. Make a select where the options are the different multisites
  96. How to redirect author subdomain pages to each author pages on www
  97. Is there a way to have wordpress 301 versus 302 urls by default?
  98. Redirect extra url to Multisite in folder
  99. Multisite move server giving redirect loop
  100. Pages redirect me to the homepage
Categories multisite Tags multisite, redirect, wp-login-form
Update event post meta each day automaticaly
I keep getting fake users registrations

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress