There may instance where you made a mistake in Settings General and changed the urls by mistake
or
There are times when you change Domain Names and move to new host and you have data with old domain name or you are transferring website from a ip address url test site like http://ip address/~cpanel_username to a domain name and you need to change on posts as well.

You login on your host cpanel and click on PhpMyAdmin icon. Some host you will need to enter the database user name and password to go to PhpMyAdmin

Once in PhpMyAdmin you will see a list of database if you have more than one click on the database you need to work on.

First thing you need to do is backup your database by using export feature in PhpMyAdmin and save it as a sql file on your computer.

If you  need to change the urls that are in Settings General  the video below will show you how to change urls click on database option.

Step below is if you are changing your domain name

If you have posts and images on your wordpress chances are that the posts  has old urls then you can change them by clicking on post table and click SQL option tab at top and add this code in box, be sure enter olddomain and newdomain with your domain names

UPDATE wp_options SET option_value = replace(option_value,
'http://www.old-domain.com', 'http://www.new-domain.com')
WHERE option_name = 'home' OR option_name = 'siteurl';

and press Go

Once you have changed the urls you will need log in admin panel and reset your permalinks by changing to default settings and save and check your pages and posts and if all is working fine switch back to custom structure and add /%postname%/ and save.

Once you done the changes you should have your wordpress back with the changes.

Get the Flash Player to see the wordTube Media Player.
Avatar of Govindji Patel

About

I am Author/Publisher WordPress Coach and Consultant who enjoys writing tutorials and helping wordpress users build better WordPress website/blog.

Related Posts

  • You saved me with this video! I appreciate you taking the time to make it and link me to it. Keep up the good work. Who knows when I might need some other form of help. I know who to go to now :) .

  • sam

    I cant see the video?

  • I just checked the video and is working fine what browser you using

  • NHJS

    I thought my site was gone for sure before I saw this easy-to-follow along video. Thanks a million!

  • glad to know that my video has helped you and as long as you keep a backup of your database you will not loose your website so keep backup on you computer.As you can always upload wordpress and use your backup database and have your website back.

  • brok

    Thanks for this! Super helpful.

  • NDEZIN

    @ Govindji:

    I found not only this post but your whole site very informative!

    I am attempting to move my URL from http://www.mydomain.com/wp to http://www.mydomain.com….can I just do that through Settings>General or do I have to go through the database?

    The new site was being constructed in the /wp directory as to allow users to have access to the old site – now that the new site is done, we want to only show the new site.

    Thank you.

  • Ndezin You have two options move all wordpress files and folders to root or use wordpress from directory. You will find instruction here
    http://codex.wordpress.org/Moving_WordPress
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

blog comments powered by Disqus
Premium wordpress theme
Skype Status
Need Help with Wordpress Chat with me - Govindji Patel: My status is Online
» Get Skype, call free! If Offline please leave Message
Become A Fan
Free Report

WordPress Optimization Secrets

Get Your Blog To Rank Higher

Register and Download Free Report

Twenty Eleven Child Theme

Upgrade and get set of 35 videos on

how to create and customize child theme

Buy Me Coffee
Donation



Other Amount:



I appreciate a donation if you find my tutorials helpfull :



Your privacy will never be compromised or shared.
Congratulations

Thank you for Subscribing Please check your email for a confirmation email