• I have brought over two lone sites into multisite. One site was running directly from an http IP address and the other had its own domain name, referenced via https.

    The site running from an IP somehow got a few subdomain references as part of the import process, and as a result, didn’t fully function after I changed it within WP to its new private domain name.

    The site running from its own domain got a subdomain reference initially from the import process and despite this is running fine as far as I can tell despite about 50 references in the WP database to the now unused subdomain.

    It seems to fix the former, I can summarily edit all URL references to make them https with the new domain name. But the fact that the second site doesn’t have every URL reference to the new domain name makes me wonder if there is any harm in updating every reference to swap the unused subdomain to the new URL with the private domain.

    I guess what I am really asking is that when switching from a subdomain to a private domain, does the WP ever in any way need access to the site as its former self utilizing the subdomain URL? It certainly doesn’t on its own go back and update them when changing the site URL.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s the import app’s job to fix up changed domains. Since you didn’t import the data and just altered how the site is accessed, WP has no reliable way to know the domain has changed. Even if it did detect the change, a completely automated update script would invariably be unreliable.

    While it’s possible to setup rewrites to allow old subdomains to still be processed, you’ll want to avoid rewrites for efficiency reasons, so I’d advise always updating all domain references in the DB. Do not do this with an SQL UPDATE query. Serialized arrays are not properly handled when you do so. Use a plugin like Better Search and Replace to update domains. It allows “dry runs” so you can verify the changes are correct before committing to them.

    Thread Starter mauricev2

    (@mauricev2)

    I think my post was confusing because I was describing a similar situation originating from two independent imports.

    neuronair.org was a lone site imported to multisite with subdomain named neuronair.einsteinmedneuroscience.org. The importer correctly changed its name to neuronair.einsteinmedneuroscience.org. Now in WP, I changed the URL back to neuronair.org and the site seems functional. However, the database still has 50 references to neuronair.einsteinmedneuroscience.org and that seems odd even if the site appears working. It would seem there is a bug in WP for it to leave behind all these references and not update them.

    The other site was a little more complicated because it started out as an IP address and many references to the IP address did not get updated to the incoming subdomain name and this I think was due to a bug in the importer because it wasn’t programmed to deal with sites utilizing an IP address.

    Moderator bcworkz

    (@bcworkz)

    WP does not attempt to detect erroneous domains in DB content. It has no way of knowing which are incorrect and which are intentional. Any serialized data aware search and replace utility can effect appropriate change fairly easily. It’s not really any harder than making a similar change in word processing documents. You can correct any IP remaining references this way as well.

    The old domain probably works because there’s a redirect set up to handle stale external links. It’s better to avoid redirects by providing correct URLs to start with.

    Thread Starter mauricev2

    (@mauricev2)

    It turns out there are a whopping 1590 incorrect links in the domain I referenced above (neuronair.einsteinmedneuroscience.org as opposed to neuronair.org), not 50, but I’m not seeing anywhere where this is having a detrimental effect. The site is working, so it’s not clear what these links are there to do (and this is a very tiny site).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘why does WP store old site URLs and is it bad to “fix” them?’ is closed to new replies.