Move wordpress site to directory

Post Reply
mister_v
Posts: 165
Joined: Thu Mar 04, 2010 9:19 pm

Move wordpress site to directory

Post by mister_v »

Hi,

I created a wordpress site on directory of my main site (www.website.com/subdir).
Now I want to move it to the root directory as the main site (www.website.com)

I tried just to copie the files, but that didn't work.
So how do I do it properly ?

Kind regards

chris
Site Admin
Posts: 167
Joined: Mon Jul 21, 2008 9:52 am

Re: Move wordpress site to directory

Post by chris »

It is a complicated process.
Moving the files from subdir to the root,
is the first step, but some additional steps are needed.

Actual the first step should always be tot do a backup of your files and of the database.

Preparation
  • Backup the files and the database!
  • Remove any old site files from the root directory
    some files, definitely files with the same name can cause problems.
  • Caching can also cause a problem, clear it or disable it.
  • Install the velvet Blues Update URLs plugin - Update the URLs in the database.
Moving WordPress
  1. Go to Settings > General and change the WordPress Address and Site address.
    WordPress Address (URL) http://www.website.com
    Site Address (URL) http://www.website.com
  2. Move all the files from the sub-directory to the root (with FTP or cli-commands).
  3. Login to WordPress http://www.website.com/wp-admin
    Go to Setting > Permalinks and click Save Changes
    This will rewrite your .htaccess file with the new URL
  4. Update URLS with Velvet Blues.
    Under Tools > Update URLs, type the website address containing the subdirectory in the old URL files and the website without the subdirectory in the New URL field.
    Be sure not to end the URLs with a forward slash '/'.
    Don't select Update all GUIDs, this can cause problems.
    Click the update URLs Button.
  5. Test the site to make sure everything is OK

A good tutorial can be found https://askwpgirl.com/move-wordpress-subdirectory-root/

Post Reply