Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Webmaster > Tips and Tricks

September 21st, 2007, 15:17 GMT · By Adrian Placinta

How to Move Wordpress Directory

SHARE:

Adjust text size:



Enlarge picture
Sometimes you may need to change the working directory of Wordpress within your server. The good news is that you don`t have to reinstall Wordpress. If the database and URL remains the same, you will have to copy only the files and the database. If you change the database name or the username, you must run again wp-config.php to set up the new
values.

The first step is to create the new folder and then copy all the files from the older folder to the new one. If you want to move the files to the root directory of the server, you will have to copy everything including .htaccess file and index.php. Then login to the administration panel of your blog and go to Options/General panel. From there you will have to change Wordpress Address (the url of the new location that contains the Wordpress files) and Blog Address (this link should be the same with the Wordpress Address). After you press the Update button you can`t login again to the Administration Panel, so make sure you do all the changes correctly.

The next step is to delete the files from wp-content/cache folder. If you use Permalinks, the next step is to update the Permalink structure to the .htaccess file from Administration Panel/ Options/ Permalinks. .htaccess should be in the same folder as index.php.

If you want to work everything just fine, don`t move the files before making the changes with the Wordpress address. If you did it, there is a solution. Using a symlink (kind of shortcut) and the following command ln -s /path/to/new /path/to/old everything will be ok. /path to old is the directory from where you moved the files and /path/to/new is the folder where you copied the files.

After that, the last step is to test your website to see if everything is ok. If you have problems with the images you will have to change the paths to the images from the SQL database.
FILED UNDER:
Wordpress
plugins

TELL US WHAT YOU THINK:

18,784 hits · 2 comments · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


Maintenance Tasks for Wordpress

Install Wordpress

Configure Wordpress (II)

Configure Wordpress (I)

Best Plugins for Wordpress

READER COMMENTS:


Comment #1 by: Shirley on 04 Oct 2008, 17:59 UTC reply to this comment

We just released a plugin which updates all permalinks and links after a move. Previously, the only option was to do this manually via an SQL query.

Check out the plugin at: http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/


Comment #2 by: unknown on 16 Jul 2010, 20:57 UTC reply to this comment

Thanks for the article.

I used this successfully to move a newly created blog from one directory into another under the same main directory. I did run into one issue with your instructions.

You start of saying "The first step is to create the new folder and then copy all the files from the older folder to the new one."

Then after I completed this, two paragraphs later you state: "If you want to work everything just fine, don`t move the files before making the changes with the Wordpress address."

So is the first step really the first step?

For those others who head here for answers, what happened to me:

Preface: I just created my first blog site, and in the process created a really stupid directory name. I thought as long as I made this mess early, I would try to move my site to a new location with a better name and learn how to make this magic happen when I could not really damage anything.

To move the site, I first created the new directory and copied all my files into the new directory using the host provider access to the site. Then when I hit paragraph three in the article I went back and deleted all the files I just created.

Then I went into the original blog administration panel and changed the settings over to the new directory as it says in the article, even though it did not exist anymore. Upon saving changes, the blog manager errored out, because of course the new directory did not exist. I hit back in my browser, and then logged out of the blog administration window.

I went back to my host administration tool and created the new directory and copied across the files as explained in the article. I then checked to see if the new site existed using my browser, and it did. I logged into the blog site administrator and double checked the settings had taken, and they had. Finally I went back to the host administrator and deleted all the files from the original blog site.

So far everything is fine.

PS - It there is an update to this article pls post a link. This article still appears very high when searching for help using Google.

Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM