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.
Hi there, I actually came across your blog from your YouTube video on using Backup Buddy to change domain names. Per your recommendation I’m considering using Backup Buddy to change my own domain but I have a couple of lingering questions. First I do want to state that I’m SUPER-green when it comes to all of this even though I’ve been blogging for a bit, so I apologize for my ignorance when it comes to knowing or even speaking about some of this stuff. Now for the questions,
1. If I use Backup Buddy and follow the video, will the blog still be in the Root directory? I ask because I’m planning on creating at least one more blog using multi site and I remember that having your blog located in the Root and not a subdirectory was a prerequisite. In the video you say that it is in the Root directory, but it looks like “/public_html/exampledomainname” which I would have thought was a subdirectory. Here’s where my baleful ignorance comes into play, is that considered a Root directory? Currently all my WordPress files are just hanging out untethered in the “public_html” folder which I thought was the Root directory. Perhaps I’m misunderstanding what the Root directory is.
2. After I complete the process outlined in the video, would I have to do any of the steps listed in the WordPress Codex here: http://codex.wordpress.org/Changing_The_Site_URL
3. Would I have to complete any of the other instructions you include in this post, like “Edit your wp-config.php file” or “Edit Your Database” if I use the Backup Buddy plugin? What about Velvet Blues plugin, would that still apply here with Backup Buddy, or would all of that be taken care of with Backup Buddy? From the video it looks like everything would be taken care of with just Backup Buddy, but maybe I’m missing something. Sorry if the questions are stupid, but I just want to make sure I understand how this works before committing to it only to find out it won’t perform certain operations that I was expecting.
4.I’m assuming that I would still have to do the 301 redirects as outlined here (or use a “redirect plugin” as you mentioned?): http://yoast.com/change-domain-name/, correct?
Brad Dalton says
Firstly, Please grab an avatar from Gravatar.com
Here’s a video i made which explains Root Directory location & public_html http://youtu.be/abpuY8t3y8Q
1. public_html is root directory. I have 16 file folders in my public_html root directory for different sites so i would place the zip file backup in the one i wish to restore the site to. In your case, if you only have one site then use the entire public_html root directory
2. There’s no steps needed when using backup in reference to the WordPress Codex as that’s a manual method they are using
3. simple follow the backup steps which you will see when you type in http://www.yourdomain.com/importbuddy.php
4. No redirects are needed. Its all taken care of by the plugin