When WordPress is installed, it will only work correctly within the folder that the program was installed in. In order to move WordPress to a different folder within your account, a few modifications to the coding is required. For example, you may need to do this if originally you installed WordPress on yourdomain.com, but later decide that you want the WordPress site in yourdomain.com/blog.
Moving your WordPress website to a new folder is easy! There are different methods to complete this task, however this is the way that we recommend:
Now that you have opened the wp-config file, you will just need to add two lines of code to let the WordPress software know the new location of the website. In your wp-config file you will see coding that looks similar to this:
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt.
*/ define('DB_COLLATE', '');
After the coding that looks like the example above, you are going to enter in two lines of code:
define('WP_HOME','http://example.com/newlocation');
define('WP_SITEURL','http://example.com/newlocation');
Make sure that you keep the formatting exactly the same, and replace example.com/newlocation with the folder that you moved your WordPress website too.
You can navigate to the new location in your web browser and make sure that it worked. If it does not appear, then make sure that the added code is correct as the exact syntax and capitalization must be used for it to work properly.
Congratulations, now you know how to Move your WordPress site to a different folder!
23 Points
|
2012-05-28 11:48 pm
I think I;m almost there. I copied the content of the Public-html/wordpress folder to the public-html folder and edited the but when I edited the /home/pikeli5/public_html/wp-config.php file as directed to add define('WP_HOME','http://pikelions.org/public-html');
define('WP_SITEURL','http://pikelions.pikelions.org/public-html'); . Now I get the original word-press seti I initially tried to setup instead of the Premium Site Builder one (a good thing) but all of the pages that were in the public-html/wordpress directory don't show up and I can't login to word-press any more:-( |
62 Points
|
2013-08-11 10:58 am
Can we also move wordpress (or other software) from a sub folder to a subdomain? For example, can we move a wordpress blog from example.com/blog to blog.example.com ?
If so, is the process the same? |
Staff 17,314 Points
|
2013-08-12 9:04 pm
Hello Joe_Shiki,
Thanks for the question. If your Wordpress files are already in the folder for the subdomain, then you don't need to move them. The main thing you'll need to worry about is the URL. You will need to update the URL as per the article above. This would be in addition to creating the subdomain entry in the cPanel. I hope this helps to clarify the issue! Please let us know if you have any further questions or comments. Regards, Arnel C. |
n/a Points
|
2016-01-26 12:08 pm
Does this process take care of old social media and other shared posts? In ohter words, by doing this will all previously posted and shared links work normally? |
Staff 1,348 Points
|
2016-01-26 7:42 pm
Yes, since all of the critical data for your site is in the database, everything should remain unchanged if this process is done correctly.
|
n/a Points
|
2016-01-27 10:15 am
Sorry if this question sounds unncessary, but do you mean to say if for example a post has two embeded external links in it https://abc.com/123/xyz/sample and an image link http://xyz.pqr.com/123/sample and the post has been shared on social medias and also sent through email / newletters. Will all those who click on those links be able to land on the right destination if the website folder is changed as per the above process? In other words, will not those links look for those particular directories mentioned in the links and return error 404? Or is this all taken care of by the database?
|
Staff 17,314 Points
|
2016-01-27 8:05 pm
Hello Mayapur Voice,
The article title is mis-leading. I have it on the list of articles that will be re-written to be clearer about the actual process of moving WordPress into a different folder. The process above actually allows you to set it so that WordPress LOOKS to a different location for the WordPress files. This is very often the case when people install WordPress into something like http://wordpress_site.com/blog and then want their URL to be only http://wordpress_site.com . If you want to have the actual WordPress documentation on moving a WordPress site, please see Moving WorddPress. This is directly from the WordPress Codex. Apologies for the confusion! If you have any further questions or comments, please let us know. Regards, Arnel C. |
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: | 757-416-6627 | Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!