References to other site everywhere in WordPress site

I am relatively new to WordPress, have been handed a site developed by someone else on one server, and have to deploy it to another. This site has bbpress installed, plus a load of other stuff. However it also seems to contain (somewhere) references to the other developers server, so even though I have copied the site onto my server all the links still point to his. I’m assuming that somewhere in the template files or database there is a reference to his site but I don’t know where. I’ve done a search / replace and replaced what I can find, but still the same thing happens. I’m just wondering if there is any really obvious place I need to look for things like that. It seems to me he has just done something pretty stupid by hard coding references to his site; but maybe it’s for a good reason, I don’t know.

3 Answers
3

There might be hardcoded links in the theme; download it and do a multifile search with a text editor.

Editing the text dump destroys serialized data; see another Q/A here: Why is my database import losing text widget data?

Update 4/19/2015 To correctly change URLs in the database, the SQL queries below will work when run in phpmyadmin or adminer, but it is much better to use a tool that correctly deserializes/reserializes php data, like https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name="home" OR option_name="siteurl";

UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');

Leave a Comment