How to move a Wordpress blog to another directory

Procédure

When should I change the installation directory for my Wordpress blog?

If you install your blog in the"wordpress" directory of your FTP space, your site will be visible at the following address: http: //mondomaine.com/wordpress/.

This is not the best solution for remembering the location of your website. What's more, it may affect your website's SEO.

The best thing to do is to consider moving your Wordpress blog so that it is directly visible at the address http://mondomaine.com/.

This help will show you the steps to follow step by step to carry out this operation.


What do you need to move your Wordpress blog?

In order to move your Wordpress blog, you need..:

Back up your data.

This operation is not without risk. Before you start, it is important to make a full backup of your site and your database so that you can retrace your steps in the event of complications. If you make a mistake, your website may no longer be displayed.

Export your database

Connect to your PHPMyadmin interface using your MySQL connection settings.

- On the left-hand side, click on the database corresponding to your Wordpress blog

How to move a Wordpress blog to another directory


- Click on the"Export" tab. This will create a backup of your database.

How to move a Wordpress blog to another directory


- Click on the"Execute" button to start downloading an export file with the name"mabasewordpress.sql".

How to move a Wordpress blog to another directory

Modify your export file

- Open the file downloaded in the previous step using a text editor.

How to move a Wordpress blog to another directory


- If your Wordpress blog is currently visible under the url"http://mondomaine.com/wordpress/" and you want it to appear under the url"http://mondomaine.com/", use your text editor to go to"search/replace". In the"Search" section, enter the current URL of your Wordpress site. In the"Replace with" section, enter the new link to your website.

How to move a Wordpress blog to another directory


- Save the modified file.

Create a new database

From your LWS customer area, create a new database.

Import your database

- Go back to your PHPMyAdmin interface and left-click on the name of the database you have just created.

- Click on the"Import" tab

How to move a Wordpress blog to another directory


- Select the file you modified in step 3, then click on the"Run" button.

How to move a Wordpress blog to another directory

Copy your web files

- Connect to your FTP space via FileZilla and go to the"wordpress" directory

How to move a Wordpress blog to another directory


- Select all the files in this directory and drag them into the parent directory

How to move a Wordpress blog to another directory

Modify your blog's config file

This last step involves modifying the"wp_config.php" file located at the root of your FTP space in order to change the name of your new database:

- Edit the"wp_config.php" file located at the root of your FTP space (you can do this from LWS Webtransfert)

How to move a Wordpress blog to another directory


- Look for a line in the form"define('DB_NAME', 'mabasewordpress');" where"mabasewordpress " is replaced by the name of your database.

How to move a Wordpress blog to another directory


- Change the name of the current database to the new one: define('DB_NAME', 'madeuxiemebasewordpress');

Test

Finally, test access to your blog from the "http://mondomaine.com" address.

Conclusion

You can now move your Wordpress site from one directory to another without losing any data and without your website malfunctioning with LWS. Before moving a website, it is advisable to make a backup of your Wordpress site so that you can reinstall it in the event of a problem.

Don't hesitate to share your comments and questions!

Rate this article :

3.4/5 | 5 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

2mn reading

How to resolve a 500 or blank page error on Wordpress

2mn reading

How do I fix a 404 error on a Wordpress site?

4mn reading

How do you update your Wordpress site?


Ask the LWS team and its community a question