I'm currently developing a site we have installed on a sub-domain. 'beta.mysite.com'

We will eventually, be moving site to it's root domain. 'www.mysite.com'


any post type attachment / the files uploaded directly from post and page content editor, will the paths to staging environment ..

before 'http://beta.mysite.com/wp-uploads/2010/07/image1.jpg'

after 'http://www.mysite.com/wp-uploads/2010/07/image1.jpg'

How can I make a batch change to alter the prefix of any reference to staging site? (e.g. replace the http://beta with http://www)

Or, how can I prevent this for my next project?


Check out this search and replace plugin. The benefit of using an absolute URL is that you can easily find and replace it, either with the plugin linked above or an SQL statement or even using some built in WordPress API's. So I wouldn't do anything differently the next time.

I used the search and replace plugin when I moved domains. Worked great. I would just avoid using it on anything other than the post_content field of the wp_posts table. Using it for wp_options or wp_postmeta could get you into trouble because the whole serialized data thing.

  • Great! I'll give that a go and check back in to let you know how it turned out. I appreciate your time of day, cheers! – Michel Joanisse Sep 27 '11 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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