Here’s a simple tip in case you are migrating a WordPress install from a development server to the production server. If you don’t start with a fresh WP install and use the export/import tools, all your links, including links inside posts and pages, as well as paths used by WordPress to dynamically generate links will be still pointing to your production server.
Here’s some MYSQL commands you can run to help clean up the links:
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`,'http://11.111.111.111/~usr/','http://www.mywebsite.com/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://11.111.111.111/~usr/','http://www.mywebsite.com/');
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'http://11.111.111.111/~usr/','http://www.mywebsite.com/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://11.111.111.111/~usr/','http://www.mywebsite.com/');
In this example, http://11.111.111.111/~usr/ is the old URL from the development server and http://www.mywebsite.com/ is the new website URL.
Of course, it’s always advisable to perform a backup any time you are running SQL commands manually 🙂