Show one site and hide the rest

On the Hub, for the same site, three domains are showing up. I would like to show only one and hide the .biz version of the site and the www.

  • Predrag Dubajic
    • Support

    Hi Chuck,

    I tried checking your setting but I'm afraid that the password is no longer working.

    Basically, what the problem is here is that all of your 3 domains are loading as is, they are not redirecting to one main domain that you want to show in the Hub.
    It would be best to get in touch with your hosting provider about this and ask them to setup the redirects and add-on domains so that all of them are pointing to only one domain and that should do the trick.

    Best regards,
    Predrag

  • Chuck
    • Flash Drive

    I expected a notification by email when you replied. It's only now that I look specifically at support tickets that I have found your response.
    You've missed the point of my setup. I'm not using redirects and addon domains; instead these are domain aliases in cPanel. The goal, as previously stated, is to have each domain show properly in the address bar, pulling up the same site, while showing only the primary site in the hub.
    In order to achieve the first part of my goal, I added these lines to wp-config.php:
    /*
    * Handle multi domain into single instance of wordpress installation
    */
    define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
    define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);

    So now we have two issues:
    1. How to tell search engines there is only one site and it's not duplicate content
    2. How to get the Hub to display only the primary site.

    For the first, I think I need to set https://cwgservices.com as the canonical url; please advise if that is right and what I need to do.
    For the second, one possibility would be for the Hub to check if a url is the canonical url, and only show the site if so. Another idea would be to have a 'hide this site' option in the Hub. Another idea would be to add a 'display as' setting in the WPMU DEV plugin; if left blank it would work as is, but if filled in it would show the site in the hub only as that url.
    I'm sure this isn't a unique situation. What happens in a multisite installation? Do all the subsites show separately? Or just the network admin?
    Please help.

  • Adam Czajczyk
    • Support Gorilla

    Hello Chuck

    I hope you're well today and I'm sorry for the delayed answer.

    So now we have two issues:
    1. How to tell search engines there is only one site and it's not duplicate content

    In theory - yes, the canonical URL should help here though I admit I've never tested in in such scenario. Usually it's used for a bit different reason: to avoid "internal duplication", meaning duplication of content within the same site - while using multiple different domains for the same site actually means (for most search engine crawlers)... three different sites.

    So, canonical URL *should* help here but to be perfectly honest, I can't guarantee it will solve the issue. The expected and "bulletproof" solution would be to use 301 (or at least 302) redirects but that would, unfortunately, break the functionality that you need (domains would be redirected). But in that case, I don't see other option than canonical URL, I'm afraid, so hopefully that will be enough. Additionally, you could try actually excluding additional domains from being indexed at all either via robots.txt file or even by denying access to search engine robots via the .htaccess file (for those additional domains only) - though they would not be listed in Google then and only one (the "main" one) would be.

    2. How to get the Hub to display only the primary site.

    Multisite is actually a different case and not really comparable. The WPMU DEV Dashboard plugin and, in consequence, The Hub takes the site URL from the settings that you are actually altering (via wp-config.php) to make Site URL/WP URL dynamic... Such setup is kind of a "trick" that's not really a WP standard. In a standard single and multisite setups those will be always pointing to the single URL/domain - not multiple once. Even on multisite that'd be a case because WPMU DEV Dashboard plugin is not working on "per site" basis but "per network" via Network Admin (it would list only one site - entire multisite - in The Hub).

    In essence, the WPMU DEV Dashboard uses the "network_site_url()" core WP function to get site address (this function also "falls back" to "site_url()" function if the site's not a multisite) and those constants ("define" lines) that you're setting to use "dynamic" value in the "wp-config.php" file) are affecting what's returned by this function. Whenever any connection is made to The Hub via API that might be updated (thus adding those additional domains to The Hub).

    However, there's a built-in option that should help so give it a try please:

    1) set following line in the "wp-config.php" file (above the "/* That's all, stop editing line */"):

    define( 'WPMUDEV_HUB_SITE_URL', 'https://cwgservices.com' );

    note: update the URL to the one you want to use with The Hub if I used a wrong one above

    2) give The Hub some time to update or try to logout and login back the WPMU DEV Dashboard plugin to your account

    If that still doesn't help, also try to remove those additional domains from The Hub manually; with that define line set they shouldn't be coming back.

    Best regards,
    Adam

  • Damo
    • Design Lord, Child of Thor

    Brilliant. I came here tonight with the same issue (multiple instances of the same site appearing) and the DEFINE statement resolves it.

    Is there a complete set of documentation available for The Hub somewhere?

    • Adam Czajczyk
      • Support Gorilla

      Hello Damo

      I'm glad to hear that the solution helped you!

      As for docs, you'll find all the available docs (not only for The Hub) here:

      https://premium.wpmudev.org/docs/

      Please note though: there's no such detailed guide for that kind of configuration "tricks" there yet. We're constantly improving our docs and adding new information but also a new Hub is coming up soon and it's going to be a bit different "under the hood" (technically) so more detailed docs would follow that up in future rather than now.

      However, if you got any questions, please don't hesitate to start your own support tickets or ask on our support live chat and we'll be more than happy to assist you.

      Best regards,
      Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.