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.
The videos below will show how to use
How To Reset Urls Using Functions.php File
How To Reset Urls Using Database
@ 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
Thanks for this! Super helpful.
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.
I cant see the video?
I just checked the video and is working fine what browser you using
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
.