WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say I built a site at test.example.com, and I now have it set up so that when you arrive at example.com you really see test.example.com, my problem is all the internal links created by wordpress want to go to test.example.com. Is it because Site Address (URL) under settings is still test.example.com?

Any way/best way to fix this?

share|improve this question
up vote 0 down vote accepted

The internal links are all hard-coded; you'll have to do a search/replace in the database to fix them.

This is a good script for search/replace that will go through your posts, widgets, everything: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Download the script, and upload it into your WordPress root directory (same path as wp-config.php). Surf to the script, then follow the steps to search/replace. When you're done be sure to delete the file from your website as it's not secure and could allow someone to access your database.

Hope this helps!

share|improve this answer
That worked, except now I'm locked out and can't log back in, and my sidebar plugins have disappeared. Any ideas? I could just revert to the backup I made of the db, but I feel this is the right direction, just missing something. – Chuck Apr 17 '12 at 18:27
Ok, I'm back in now, had to change WP_SITEURL in wp-config to the new url, I've just got one plugin still stuck on the old url. – Chuck Apr 17 '12 at 18:34
Hmm, hopefully you can fix that one manually? I'm not sure why it wouldn't catch everything. – Michelle Apr 17 '12 at 18:59
Found it, WP_HOME also needed to be updated in wp-config, thanks for pointing me to that script, will come in handy again I'm sure. – Chuck Apr 17 '12 at 19:04

Your Answer


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.