At some stage you may need to update address on your website, change your domain name, site URL or change your WordPress address for one reason or another.
There’s different methods you can use to do this without breaking your links depending on whether you are trying to fix a problem or simply want to change your sites address.
If you go to Settings > General you’ll see settings for two URL’s.
4 ways To Change Your Site Address URL’s without breaking links are:
- Edit wp-config.php file
- Edit Database
- Edit Your Theme’s functions.php
- Use Plugins
Caution: Always backup your files and databases before making any changing or playing around with them.
Edit your wp-config.php file
If you haven’t edited your wp-config before, please take a look at this post i have written on how to edit your wp-config.php file and then add this code.
Change the above addresses to yours before you save the changes to your file!
Edit Your Database
Changing your WordPress URL and Site Url in your database is fairly easy as long as you understand how to use the program which manages MySQL databases which is, PhpMyAdmin.
Edit PhpMyAdmin wp_options Table
Here you can edit not only your site URL but also your home page URL and File upload URL to name a few. Download backup first just in case!
Site URL – Change To http://yoururl.com/
Home URL – Change To http://yoururl.com
File upload_url Change to http://yoururl.com
- Login to PhpMyAdmin and click the WordPress database you wish to edit in the left hand sidebar
- Click on wp-options table in the left hand sidebar
- You’ll then see your site URL in the middle of the screen which you can change
Tip: Try the Search facility in PhpMyAdmin as you may have too many tables to find your File Upload_url settings
Edit Theme functions.php
I won’t discuss this method here because it can be complicated and varies depending on individual circumstances. If you make mistakes when editing your php files, your site can break and require a professional to fix which would cost money
Change URL’s using Plugins
There’s several plugins which you can use to change different URL’s on your site depending on the reason you need to make the changes which may be:
- Moving to a new server
- Moving to a new host
- Changing domain names
- Moving from local host to live server
- Moving from a free hosted blog to self hosted WordPress.org
I’ve already written several articles on how to move WordPress using a backup, migration and restoration plugin.
Another plugin which you may not have heard of is named Velvet Blues Update URL’s. This plugin allows you to change URL’s on your entire WordPress installation.
This plugin would come in handy if you are transferring from a free hosted blogging platform like Blogger to WordPress.org because you can change all your image attachment URL’s quickly and easily.
Whats the best method?
The best method of changing your site URL’s depends on the reason you need to change them.
If you are moving servers (hosts) i recommend using a plugin.
If you are moving WordPress from a local server to a live web server then you can simply change them in your general settings.
If you are moving from a free hosted platform like Blogger or WordPress.com to WordPress.org i suggest you try velvet blues.
If you are changing domain name i suggest using the same method as moving servers.
*Don’t forget, always keep full backup of the original files and mysql databases before editing or making any changes.
Conclusion: I’m sure i haven’t covered all bases here however the Google custom search box in my sidebar works very well if you use keywords when searching for other solutions.
P.S Another method you can try is installing a redirection plugin. Some WordPress themes also include a built in 301 redirection field if you are simply wanting to change the permalink address on one page or post.
Changing permalinks on your entire site is also possible and we’ll discuss more on that in another post.