Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Update URLs When Moving Your WordPress Site

Last updated on by
Elegant Themes
How to Update URLs When Moving Your WordPress Site

If you have ever had to move your site from one location to another you know how painful it is to go back and rewrite every link and URL to point to the new location. The Velvet Blues Plugin for WordPress will do exactly that. It allows you to input your new website URL and then it automatically updates every link in your blog.

To get started, first you want to download the Velvet Blues Plugin. Once you have activated it go to the settings tab in your admin panel and select “update URLs”. You will then be shown a screen that allows you to type in your old website URL as well as your new website URL.

Update Urls

Choose which URLs you would like to have updated and as soon as you press update URLs all of the links in your site that you selected will be modified. Although this saves a lot of time, you will still have to go back and manually change any links that are hardcoded. This is by far the easiest and effective solution that we know of that allows you to update your post URLs in WordPress when switching sites.

Download the Velvet Blues Plugin for WordPress here


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Robin Jennings says:

    Great plugin. Worked a treat and saved me hours of time!

  2. Johanna Summers says:

    We ran Velvet Blues today to try to fix the image urls that appear with the temp url address in the html on each page ( but correctly as the file url in our WP Media – eh?) – it hasn’t changed them – we now have the blues? Why didn’t it work? (we moved our site to WP about 3 weeks ago.. stressed!

  3. Vincent says:

    Hi,

    Great article. Thanks.

    Unfortunately I am still confused about whether “updating the URLs” using these special plugins is actually necessary for when you’re simply taking a development site (in a subdirectory, say http://www.example.com/wpdev) live on the root domain, and not actually moving any files??

    For example, I did a test and made my http://www.example.com/wpdev site live by following the instructions is the WordPress Codex. I simply changed the wp site URL in general settings, put a copy of the index and htaccess file in the above root folder (and tweaked index.php to require the subdirectory), updated permalinks and viola: everything works including my links to my attachments in posts.

    Curiously however, when I then “update the URLs in the database” using a dedicated plugin, then it actually breaks some of my links. Note I update all the tables except the options table as this has the wp home url link which should remain as example.com/wpdev/

    I actually think this topic is one of the more unclear parts of the WordPress Codex.

    Perhaps I don’t understand the difference in effects between hardcoded links and non-hardcoded links properly?

    Cheers

  4. Mimi says:

    I ran the plugin and it seems it did not update any of my links so I have to them all manually :(

  5. Felix Whelan says:

    I have been blogging for a while using domain name A. I am changing to a new domain name, domain B. But I have the same hosting account with the same host. I want all my old posts to stay right where they are. I just want my new domain name to lead to them. Essentially, someone who logged in to domain A yesterday would be able to click domain B today and get to the same experience. Will this plug in accomplish that? Thank you for your help!

    • WPBeginner Support says:

      On your hosting account edit your Domain A and point it to some other directory. After that Edit domain B and point it to the directory that was previously used by domain A. You can also ask your webhost for support. After that you will need this plugin to update your URLs, you will also need to update your WordPress site and home URL in wp-config.php file to make sure it is pointing to domain B.

      define('WP_HOME','http://example.com');
      define('WP_SITEURL','http://example.com');
      
  6. Todd Lohenry says:

    Is there a way to do this with WordPress.com?

  7. Joy says:

    Hi,

    I need a little help. I activated the Velvet Blues plug-in, and had it update my URLS for my old site site.olddomain.com to move to newdomain.com, but now when I do a Google search and click on old links at the site.olddomain.com I get “Not found, error 404″ on the newsite.com. How can I fix this?

    Also, I’m pretty new to this tech stuff, how do I “manually change any links that are hardcoded”? What’s a hardcoded link?

    Thanks in advance!

    • WPBeginner Support says:

      The plugin updates your URLs in the database but you still need to import your old site first and set the permalink structures.

  8. Elizabeth says:

    Forgive my ignorance. I’m fairly new to all this and I may not be using the right terminology but I migrated from .com to .org last week. I didn’t see the “move your blog” tutorial from wpbeginner until after and so I followed my new hosts tutorial which was MUCH more difficult and technical. Anyway… I’m moved. Everything appears to be working fine but my images are still pointing to the old site. From what i read, this plug in would help but I’m stuck on old url/new url. Isn’t my url the same as my domain name? And my domain name stayed the same when I moved so… I’m a little lost there. On my NEW admin page I can go to settings>general and see that my “wordpress address” and “site address” are both the same as http:// mydomainname which is what I’ve always thought of as my url, both before and after I moved. On my OLD admin page (.com) I can’t see my “wordpress address under general settings. How do I differentiate?

    • WPBeginner Support says:

      We are sorry, but we can not understand how can your old site and new site have the same domain and how can they both be live at the same time? Can you please reply to this comment with your old and new site URLs?

  9. Marshall says:

    O my god!
    When did it happen. Can’t wait to give it a try…
    Doing it via database is painful.
    Thanku

  10. RW says:

    Love this whole post and discussion. Some great ideas. Personally, I don’t think this is worth a plugin. I always use an SQL query or export my DB and use text editor to find and replace, then re-import. Works great. Obviously, hard-coded links have to be done manually.

    I just don’t love the idea of using more plugins unless I have too. Chuck, I’ll try out your SQL next time. Thanks for the tip!
    Bob

    • Vincent Robic says:

      I totally agree with you, but in some case, settings are stored as serialized array, and it’s more convenient to use a plugin.

    • Editorial Staff says:

      Why add more work for yourself, when a plugin can do it just fine. This is not a plugin that you keep active on your site. You install it, use it, and then delete it.

      • RW says:

        What about if you’re moving a site from a sub-directory to root or even the other way around? Can this plugin handle that as well?

        • Editorial Staff says:

          Yes. Because all it is doing is a search and replace in your database. This is very handy for those who don’t want to go in their phpMyAdmin. Plugins like Duplicator are more useful because they do the whole migration process and then this.

  11. Vincent Robic says:

    Hi,

    I just wrote a plugin that does the job. It also handles serialized data, VelvetBlues Update URLs doesn’t do at the moment ;-)

    You will still have to manually update the siteurl option in order to access the Administration Panel, but then, it will update all your stuff : posts (including pages and custom post types), excerpts, medias, custom fields, options, GUIDs.

    It’s available on the WordPress Plugin Directory : http://wordpress.org/plugins/umanit-update-urls/

    • Dotta Raphels says:

      Hi Vincent,

      I’m new to WordPress.org and would please like an idiot’s guide to installing this plugin. I host with GoDaddy. I just moved over and none of my links work. Please help!

  12. zimbrul says:

    This is something I didn’t know…used to do this manually …good tip.

  13. jeroenhoman says:

    @viking_olof Just what the doctor ordered! You saved me a few hours of rewriting my URLs…

  14. samuelcane says:

    @wpbeginner you wouldn’t believe how timely your tweet was, just moved from dev to live when I noticed my URL’s! thanks so much! #panicover

  15. easyP says:

    Hi Everyone

    I came across this plugin recently and will be trying it this weekend.

    I developed a site on a temporary URL, which means that all the URL’s for the graphics need updating so I’ll be using it for that.

  16. Adam W. Warner says:

    Yeah, this seems like a mostly un-useful plugin unfortunately. @chuckreynolds and @wpstudio advice below are both useful, use BackupBuddy (because it handles the search/replace, or do it manually with those SQL queries.

    However, one thing that I’ve run across on multiple occasions is that some plugins are using serialized data strings to store data and a simple SQL search/replace won’t update that data. BackupBuddy search/replace does account for serialized data, but I’m not sure it checks recursively.

    My method for migrating sites is using a mix of BackupBuddy, then running the awesome Serialization Fix script from Interconnectit.com. http://interconnectit.com/124/search-and-replace-for-wordpress-databases/

    I migrated a Multisite installation where the client had used a plugin that stored it’s data in serialized arrays and after the migration over 300 content blocks were missing. Running the script above saved the day;)

    • wpbeginner says:

      @Adam W. Warner Great suggestion Adam. This plugin might be a bit irrelevant when making the initial move, but it is a good free alternative for anyone who is not very well-versed with MySQL knowledge.BackupBuddy for the win though.

    • chuckreynolds says:

      @Adam W. Warner Nice, thanks Adam that’s useful. Cheers

      • Adam W. Warner says:

        @chuckreynolds Sharing our collective experiences is all part of being in the community:)

        p.s. Sorry to hear you won’t be involved in another WordCamp Phoenix, but I understand it’s a HUGE undertaking;)

  17. wpstudio says:

    This is why I love BackupBuddy. It updates all the URLs for you when you migrate a site.

  18. chuckreynolds says:

    plugins typically fail for doing this as most of the time you’re moving from a temp url to a domain and once you’re moved over you can’t use a plugin becuase of the redirection in place to the old url.

    The SQL queries to run to fix all that are here: http://forr.st/~DLR

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.