Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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'

Problem?

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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

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.