Updating URLs after taking a subdirectory install live on the domain root?
-
Unfortunately I am still confused about whether “updating the URLs” using special search and replace plugins is actually necessary for when you’re simply taking a development site live on the root domain, and not actually moving any files?? That is you’re simply following the instructions on Giving_WordPress_Its_Own_Directory
For example, I did a test and made my development site https://www.example.com/wpdev live by following those instructions “Using a pre-existing subdirectory install”. I simply changed the wp site URL in general settings, put a copy of the index and htaccess file in the above root folder (and tweaked index.php to require the subdirectory), updated permalinks and viola: everything works including my links to my attachments in posts.
The trouble is the wordpress codex says:
f you already have content in your site, see when your domain name or URLs change for how to deal with references to the old URL that will remain in the database.
and
When your domain name or URLs change – i.e. from https://example.com/site to https://example.com, or https://example.com to https://example.net – there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.
Curiously however, when I actually “update the URLs in the database” using a dedicated plugin, then it breaks some of my links. Note, I update all the tables except the options table as this has the wp home url link which should remain as example.com/wpdev/
I actually think this topic is one of the more unclear parts of the WordPress Codex. That is when do you actually need to update URLs.
Perhaps I don’t understand the difference in effects between hardcoded links and non-hardcoded links properly?
I would really appreciate some clarity on this. Thanks!
- The topic ‘Updating URLs after taking a subdirectory install live on the domain root?’ is closed to new replies.