0

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?

1 Answer 1

0

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!

4
  • 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, 2012 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, 2012 at 18:34
  • Hmm, hopefully you can fix that one manually? I'm not sure why it wouldn't catch everything.
    – Michelle
    Apr 17, 2012 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, 2012 at 19:04

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.