Can WordPress change links automatically?

I keep making WordPress sites on temporary domains (say: example.com), and then to go live with them, I just move entire installation to new server and change temporary domain to live domain (say: mysite.com). This is easy.

I, however, wonder how all the internal links (say: example.com/hello) inside posts’ and pages’ content of WordPress automatically get rid of old temporary domain and get replaced with new live domain (mysite.com/hello) and things just keep working? Is there any automatic script which keeps track of the setup domain, and updates all the domained links in all posts as soon as main domain changes?

Related posts

2 comments

  1. I suppose it’s possible to create a script or plugin that would monitor the WP settings URLs in Dashboard >> Settings >> General and do a global change when needed, but such a script would be complex ad fraught with issues when handling the different img and a href links in post/page content, as well as in all the tables – plain text and serialized – in the database.

    It’s not difficult or time consuming to change the site URLs the usual way. The best references are the WP docs at http://codex.wordpress.org/Moving_WordPress

    Or search for various plugins that do much of the work for you: http://wordpress.org/plugins/ There are several to choose from, including premium (paid) plugins via a Google search.

Comments are closed.