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

Different Domains in Multisite Setup

When you log in, WordPress sets a cookie in your browser to mark you as authenticated. The COOKIE_DOMAIN sets the scope of this:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#Scope_of_cookies

i.e. the browser will only send the cookie back to sites that match its scope. i.e.

  • if you log into example.com, WordPress will give you a ‘wordpress_logged_in’ cookie scoped to example.com.
  • if you go to sub1.example.com, then this matches the example.com scope and so your browser will send the wordpress_logged_in cookie.
  • if you go to example.net, this is out of scope for the example.com wordpress_logged_in cookie and so it is not sent to example.net.

How to make this work? You need a mechanism where example.net will make a request to example.com as part of the login process (or in the background when you visit the site) to check if you’re logged in there, and if so the sites exchange a signed token which will authenticate you to example.net and so it can set a logged in cookie for you. StackExchange, for example, have a separate domain stackauth.com for just that. Or trigger this at login time one example.com so it calls out to example.net at the same time to set cookies there. Or delegate the login to example.com so you just have to click the login button on example.net and it’ll redirect to example.com, find that you’re signed in there and redirect you back to a ‘authenticate me here too’ endpoint on example.net with a signed token – so you do still have to click ‘login’ but not enter your credentials again.

There are plugins that exist to solve this, e.g. WP Multisite SSO. I haven’t tried it myself and so can’t recommend it. It would be an interesting problem to code up yourself, but it’s going to be a fair amount of work!

Related Posts:

  1. How to use WordPress Multisite With Different Domain Names?
  2. Anyone figured out how to use WordPress MultiSite with Domain Mapping & SSL?
  3. How to use alias domain for multisite installation?
  4. How To Provide Sub-Blogs Their Own Domain Names?
  5. Changing Multisite URL after the subsite has been in use
  6. How do I use different domain for subdomains in WP Multisite?
  7. Subdomain and subdirectories together in one installation
  8. WordPress multisite with multiple parent domains
  9. WP Multisite – domain mapping to domain.com and separate site to domain.com/help
  10. How to host blog on separate domain from main site
  11. WordPress Multisite domain mapping with different IPs
  12. WordPress Multisite Strange Redirect on Primary Site
  13. One WordPress Installation for 2 Domains
  14. Link structure, WordPress IIS
  15. Install multisite wordpress on a subdomain and map to top level domains
  16. Multisite – One Site with multiple URLs
  17. Multisite on single wordpress
  18. Folder structure when using multiple domains with WordPress
  19. Infamous admin login redirect
  20. Is there something I need to know in order to use WordPress on foreign (Swedish) TLDs?
  21. Serve theme and plugins assets from correct domain on multi-domain multisite
  22. new WPMS site not working / Q setting up new site/subdomain
  23. Multisite redirect loop for a single www domain
  24. Some Subdomains on a Multisite Install Not Found
  25. Best Way to Setup a Network of WP Sites?
  26. How To Add Custom Form Fields To The User Profile Page?
  27. Specific upload folder for PDFs in custom Post type in WP multisite
  28. Is there a is_user_logged_in() for multisite?
  29. Setting up a wordpress network with third level domains
  30. How to delete post revisions?
  31. Add additional Network constants to wp-config.php dynamically
  32. Can a multisite’s blogs be accessible from two different sub-domains?
  33. WP Multisite development with Mamp Pro and wildcard subdomains, not really working for me
  34. Can upload doc and pdf but not ppt – not permitted for security reasons
  35. Domain mapping (without plugin) in 4.5.x multisite?
  36. How will self-hosted WordPress work with Google Page Speed Service?
  37. Multisite Domain Mapping with SSL
  38. multisite: use a virtual subfolder for subblogs
  39. How to set up wordpress domain mapping on MAMP Pro
  40. How do I transition multiple installations to a single Multisite installation?
  41. WordPress Multisite with multiple domains using Nginx
  42. Steps for Moving Multiple WordPress Installs to a Multisite Install?
  43. What is the best way to load the WP environment in a subdomain of my multisite WordPress install?
  44. Best way to develop multisite and deploy on another server?
  45. WordPress Multisite. Can domain be used instead of subdomain?
  46. domain mapping confused about sunrise
  47. MU domain mapping login issue
  48. Removing My Sites menu from Admin
  49. Unable to login to new custom domain on multisite?
  50. Prevent Deletion of Blogs
  51. share login/logout sessions across two installs?
  52. sunrise.php for multi-network install of domain mapping plugin
  53. How to Login Once to an Entire WP Multisite Network
  54. NGINX Multisite Rewrite rules
  55. How to Set up a Multisite WordPress?
  56. Multisite, turn off “create new site”
  57. wp-admin slow in multisite
  58. Infinite loop problem with the WordPress MU Domain Mapping plug-in
  59. WordPress multisite with domain mapping and virtual host on local with fake domain
  60. Is it still only possible to do multisite domain mapping with a plugin in WordPress 4.1?
  61. How to manage multiple domain with different languages on each domain with single wordpress installation?
  62. “Preview Changes” button doesn’t show changes for previously published posts/pages
  63. Localization For Two Different Regions/Domains with the Same Language
  64. Multiple Domains and Subdomains Using Multisite Installation
  65. restore_current_blog() vs. multiple switch_to_blog() followed by removing $GLOBALS[‘_wp_switched_stack’]
  66. How to use Multiple-Domains in one Multi-Site Installation?
  67. How to let a single post have its own domain name
  68. Multisite – Redirect All Users to Subsite Home Page on Subsite Login
  69. How to add new sites and map a custom domain in WordPress Multisite?
  70. What are the differences in capabilities between the super-administrator and administrator?
  71. WordPress multisite with different domain
  72. Network setup tab is not shown under Tools
  73. How to move theme directory but not plugins/uploads out of WordPress root directory?
  74. Trying to migrate a WordPress Multisite with Domain Mapping
  75. Multiple blogs, different domain names, one install to rule them all
  76. How To Modify New Sub Blog Immediately When Super Administrator Creates It?
  77. W3 Total Cache – How to disable “Performance” menu under multisite? [closed]
  78. Hide root site in Multisite install
  79. WordPress Multisite Login Access
  80. Jetpack Blog Subscriptions on Multisite [closed]
  81. How do I add JavaScript that will execute on all my sites in Multisite?
  82. How to prevent first post and first comment on WP MU?
  83. Multiple Multisite networks on the same domain?
  84. subdomain mulitsite on localhost in a subfolder
  85. WordPress Network for regional company websites
  86. How to do Domain Mapping to Subdirectories?
  87. Possible to create a multisite network where the main site is non-WP?
  88. Limit multisite/network site names to a property of the user
  89. How do I park secure.primary.com on top of the multisite ID:1 domain: www.primary.com (primary multisite domain)
  90. Multiple domains with different child themes on one installation?
  91. How do I maintain static directories on multisite subdomains?
  92. Why are images not displaying?
  93. Replacing the default content created while the site creation
  94. How to configure DNS If I use the plugin yet-another-multi-site-manager?
  95. WordPress MU Domain Mapping Customizer Error
  96. Multisite Subdomain Using More Resources Than Others?
  97. Changing admin sub-domain in WordPress multisite
  98. How to properly force https and www on multisite with Apache HTAccess
  99. Why are images uploaded to main domain, when using multisite with different domains?
  100. Subdomain login problems
Categories multisite Tags customization, domain, domain-mapping, login, multisite
Why does admin-ajax load slow and what are ways to speed it up?
Benefits over using object method over property from $product?

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