I'm currently developing a wordpress version of a website on a dev.acme.com domain, while the old site (www.acme.com) remains active (if it's relevant, it's not on a wordpress platform.) The content will be migrated over at some point (that part has been tested and is going to work fine.)

All my URLs (for images and links) inside posts are relative, so there's no worry about them when I switch to live....

But I notice that Yoast stores its FB images with an absolute path of dev.acme.com, and I think I am hearing that WP stores its featured images that way too.

Any things / thoughts for how to avoid utter chaos on these two stored image paths when I do switch live?

  • 1
    WP uses attachment IDs, the best practices part of your question would be out of scope here as it's a discussion rather than a question, but I won't close as you can edit that part out to make the question specific enough to be answered in a concrete manner
    – Tom J Nowell
    Apr 11, 2018 at 0:34

2 Answers 2


My go-to procedure for moving sites from one place (domain/etc) to another is WP Clone from WP Acadamy https://wordpress.org/plugins/wp-clone-by-wp-academy/ . Works almost every time very easily. (Sometimes it doesn't work the first time, but do it again and all is well.)

Adjusts all links from the old domain to the new domain. Moves everything: posts, pages, themes, plugins,settings, etc.

  1. You should never use relative urls as you never have any idea relative to what they are going to be.

  2. Content should be authored only on the production site (or a special content staging site if such a thing exists). Development sites should be only about development of code (whatever form it is in, php, js, css etc).

If content changes are essential part of the change from the old design to the new one, you should set a new server that will be the new production for the new version, use your hosts file to point the domain to it when you need to add content, and when the time comes to make the switch just change the DNS settings for the domain.

  • note that this answer have nothing to do with wordpress itself and should apply to any cms that separates code and content Apr 11, 2018 at 4:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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