Updating URLs in many posts

I copied my WP content to a new install on a different server, so now my uploaded PDF documents have the old URL. Is there a simple way to fix that in all my posts at once, perhaps with SQL or some plugin ?

Related posts

Leave a Reply

3 comments

  1. Go back to the old install. After you exported the SQL database, open it up in any text editor and do a “search and replace”, taking your old url and replacing it with your new url. So if I’m going from http://localhost:8888/testsite to http://testsite.com, I need to a search and replace:

    • Search: http://localhost:8888/testsite
    • Replace: http://testsite.com

    Make sure you leave off the / at the end as you may miss a few URLs when you do your replacing.

    Now just import this new database into the new install.