Change the Site URL and Home URL on a WordPress Site
If you move your WordPress site, you may have trouble getting your pages to show correctly. Often this problem is caused by two WordPress settings: the Site URL and the Home URL.
These are normally easy to change by going to Dashboard > Settings > General settings page. But sometimes that’s difficult to do because the move has broken your access to the WordPress administrator area.
Here’s how to fix the problem.
Step 1. Choose the correct database in phpMyAdmin
In this tutorial we’re going to use phpMyadmin. Most hosting companies will give you access to phpMyadmin via your hosting control panel. If they don’t, they will probably give you a very similar alternative.
- Access phpMyadmin.
- Select the correct data base to edit. If you only have one installation on your server, you will only have one choice. If there are more, be sure you are getting the right one.
Step 2. Find the wp_options table
- Click on wp_options
- Find option_name siteurl.
- Click the checkbox then Edit.
Step 3. Edit the option_name value
- Change the option_value to the correct URL.
- Scroll to the bottom and click “Go” to save the change.
Step 4. Repeat for the home URL
- Search or scroll to find “home”
- Repeat the process.
- Done!
Expert Option
Or optionally, go to phpMyAdmin and run this SQL query (replace www.domain.com with your domain):
UPDATE `wp_options` SET option_value='http://www.domain.com' WHERE option_name='siteurl' OR option_name='home';
Be sure you have a backup before you try this.
Hi,
This is good but not enough to get all working. Without updating the posts’ content and medias for example, the pictures won’t show.
I just wrote a plugin that handles URLs in options as you do (including serialized ones), posts, excerpts, medias, custom fields and post types.
It’s available on the WordPress Plugin Directory : [url=http://wordpress.org/plugins/umanit-update-urls/]http://wordpress.org/plugin…[/url]