migration – Images in the post still pointing to older domain after domain change


Image URLs are just saved as HTML in the database. They’re not going to change just by changing the site URL. You need to do some sort of search-replace. This is covered in the documentation on moving WordPress:

When your domain name or URLs change 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.

If you do a search and replace on your entire database to change the
URLs, you can cause issues with data serialization, due to the fact
that some themes and widgets store values with the length of your URL
marked. When this changes, things break. To avoid that serialization
issue, you have three options:

  1. Use the Velvet Blues Update URLs or Better Search Replace plugins if
    you can access your Dashboard.

  2. Use WP-CLI’s search-replace if your hosting provider (or you) have
    installed WP-CLI.

  3. Use the Search and Replace for WordPress Databases Script to safely
    change all instances on your old domain or path to your new one. (**
    only use this option if you are comfortable with database
    administration ** )

RTXGamer 12 months 2021-08-23T02:59:47-05:00 0 Answers 0 views 0

Leave an answer