WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When i imported all posts and media from a old site to new site which on wordpress multisite. The image links on posts are got broken because how media are stored on a multisite is quite different from a single installation wordpress site. And also the links in the contents are static so it don't change when imported.

Single installation example:


Multisite installation example:


So, you see if i can go through all posts replace old links with the new links in all image/media links it is going to work. We need to change the first part of the url. the name and the date of the media will be same as the importer will use the same publish date and name when imported.

My question is:

Is there any plugin which can do that? or some other way i can do it?

share|improve this question
up vote 3 down vote accepted

Try Search and Replace plugin which is A simple search for find strings in your database and replace the string. You can search in ID, post-content, GUID, titel, excerpt, meta-data, comments, comment-author, comment-e-mail, comment-url, tags/categories and categories-description.

share|improve this answer
Wish I could upvote twice. I had used "Regex Search" plugin for most of my S&R needs, but it didn't identify media links. This one saved my bacon! – Greg Pettit Dec 7 '11 at 15:20

Easiest way would be to do a mysql dump and just open it up in an editor (VIM) and just run:


Then re-import the database.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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