Updating Links in WordPress

Thursday, March 1, 2007 5:47 | 101 views
Posted in category Site Update

Well. I must have had a brain fart.

When I went to bed last night, my mind was racing, trying to think of a way to have all the links updated in one swift command, so that all the images wouldn’t be broken because they all linked to the old address.

Then I got to thinking. (Yea, I can actually do that when I need to. But ONLY when I need to, otherwise it hurts to much.) That file I used to export from the old site and into the new site is an XML File! This meaning that it was editable!

So I got up and opened up Dreamweaver and ran the Find and Replace script and let it run while I went back to bed.



About one hour later, I had almost four years of posts all updated! YAY!

So this morning I deleted the Database I made yesterday, so any posts I made yesterday are gone, and so are the comments. That’s no biggie. There wasn’t anything posted except me bitching about wanting to update the links.

So basicially, I just imported the edited XML file and voila!

Thanks for the suggestion on editing the Database Corey, but my way was sooooo much easier.

SociBook del.icio.us Digg Facebook Google Yahoo Buzz StumbleUpon

You can leave a response, or trackback from your own site.

4 Responses to “Updating Links in WordPress”

  1. MrCorey MrCorey says:

    March 1st, 2007 at 5:20 pm

    Do you mean the suggestion that got deleted! :p Ha ha. I’m glad that you had that easier way. Actually, updating the database would have been exactly the same process. Find and replace.

  2. MacBros MacBros says:

    March 1st, 2007 at 5:52 pm

    Actually you’re wrong Cory (Sorta’)
    You need to copy each WP post, comment, and page data-base table from that database into a text editor, and then do the Find and replace, then replace them edited tables back.

    I just had to find and replace in one file and it was done.

    Both ways will work, but editing the XML file is the easiest.

  3. MrCorey MrCorey says:

    March 1st, 2007 at 7:37 pm

    Actually, I’m right, John. I’ve done it 4 times. The trick is to use PHPMyAdmin, or cPanel’s MySql backup tool, to create a backup of your database, which will usually be a gZipped file. You gUnzip it and open the file in your text editor. Find and replace. gZip it back up and import. Done. Right. Same result. See here and this tool. Both will work, it seems.

  4. MacBros MacBros says:

    March 1st, 2007 at 7:46 pm

    No, you’re not right.
    Editing a text file is easier. (XML is practically same thing)

    Your links still look like more work than what is needed. :-Wi

    All I did was Export old site, edit the XML, then upload it to the new. 1 – 2 – 3. Done :dance:

Leave a Reply

:) :( :d :blush: :(( :dance: :x 8-| :eyebrow: :o :think: :-Wi :-w ;) [-( :peace: more »

Quicktags:

CommentLuv Enabled