How do I move my WordPress site from one folder to another? Принт

  • 1

We often receive support requests where customers have installed WordPress into a subdirectory (e.g. /wp) instead of on the root of their domain.  Luckily, this isn't a problem - there are a few steps to follow to move your site to another folder or the root directory.

Moving the WordPress files

1. Using the cPanel File Manager, remove any files in the root of the domain (be sure not to remove the subfolder containing your WordPress installation)
2. Open the subfolder containing your WordPress files
3. Select all files by clicking 'Select All'
4. Click 'Move File'
5. Enter the path you want to move the files to (for instance "/public_html/wp" would need to simply be "/public_html/" if you want to move your site to the root of your domain)
6. Click 'Move File'.  This will move the WordPress installation.  You now need to update the WordPress database.


Modifying the WordPress database to reference the new location

7. Return to your main cPanel screen and open PHPMyAdmin
8. Select the WordPress database from the left-hand menu (usually contains the letters 'wp' somewhere). You should see all the WordPress tables listed on the right
9. Click 'Export' then 'Go'. This will download a copy of the database to your computer
10. Open the file on your computer using a text editor such as Microsoft Word or WordPad (not Notepad, which can affect line breaks in the database)
11. Perform a find/replace on all occurrences of the old domain name, and replace with the new domain name. For instance: replace example.com/wp with example.com
12. Save the file
13. Return to PHPMyAdmin and select the database again
14. Click 'Check All' at the bottom, then select 'Drop' from the 'With Selected' drop-down list. This will clear your database
15. Click 'Import' and select your edited database file from your computer.  Import the file to complete the process.

Once the steps above have been completed, you may need to perform a hard refresh (e.g. CTRL+F5) of your web page to remove any content cached by your web browser.

Дали Ви помогна овој одговор?

« Назад