0

So I have two sites. Old site with old domain and new site with new domain. I've exported some posts. They have images, so when I done the import, they obviously reference the old site. Some posts have galleries and again, these reference the IDs of the old site.

Is there anyway (I presume at this point that there is always a way!) to go through the posts, check if an image references an old site, if it does, import it and update the link to the new media item?

Likewise, would I be able see what IDs are being passed to a gallery, grab them somehow, import, update etc? I see this being the trickier task

I've wrote no code so far - just wondering whether this has been raised and/or done?

Thanks

2
  • Do you have access to the MySQL database via phpMyAdmin? Also, are the images showing up as broken links or are they not transferring over? Commented Feb 22, 2017 at 23:17
  • Use any of migration plugins or Search Replace DB to make sure you've replaced all URLs in the database.
    – Max Yudin
    Commented Feb 23, 2017 at 8:44

1 Answer 1

-1

you can use WordPress native functionality Tools->import/export for all your content or for some post type.

3
  • 1
    That does not import the images that are used within a post
    – pee2pee
    Commented Feb 22, 2017 at 21:58
  • If you insert image into a post with WordPress media all will be fine. Try to export/import all post types(all site content). With this functionality work a lot of demo data importers for WordPress themes.
    – Oleh
    Commented Feb 23, 2017 at 10:08
  • No - doesn't work
    – pee2pee
    Commented Feb 23, 2017 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.