• Resolved bpetruzzo

    (@bpetruzzo)


    I searched the forum and google, but didn’t find anything.

    I have a blog with nearly 700 posts. Many of them have images. I recently switched domain names. The images, naturally, are all broken now. I’m looking for a way to automatically change all images to the new domain name.

    So, for example, right now, the images are:

    https://my.domain.com/image.jpg

    I need it to be:

    https://www.mydomain.com/image.jpg

    If I switch it manually it works. So I just need a simpler way of making those switches. I thought there might be some kind of a mass MySQL editing tool that could find every instance of the old domain and replace it with the new one. Similar to how you might do it in a word processor.

    Any ideas?

Viewing 1 replies (of 1 total)
  • Thread Starter bpetruzzo

    (@bpetruzzo)

    Okay, I don’t know why I didn’t think of this before. I solved my problem.

    1. I downloaded my wordpress database and saved it as a backup.

    2. I copied the backup to another location and opened it in a text editor (text wrangler in my case).

    3. I searched for the old domain name, then used the ‘replace all’ command to replace it with the new domain name. It found several thousand instances of the old domain and replaced them all.

    4. In PHPmyAdmin, I dropped all the tables then imported my modified database file. All of my links were fixed.

Viewing 1 replies (of 1 total)
  • The topic ‘Mass editing images in posts’ is closed to new replies.