Steps to move Wordpress from root folder to subfolder

bhawanisingh

Administrator
Staff member
We can install Wordpress in root directory (root/public_html) but if you want to move your files to another folder but don’t want to change the website URL then you can follow below steps:
  • Login to cPanel.
  • Click on File manager >> Public_html folder >> Here create another folder where you want to move your Wordpress files.
  • After that login into Wordpress dashboard.
  • And click on “General Settings” under “Settings”.
  • Now you will find Wordpress Address and Site Address field, in Wordpress address you have to mention the path of your Wordpress file and in Site Address you have to mention your website address from which you can access your website. For example: your subfolder is website, then your Wordpress Address is http :// mydomain.com and your Site Address is http :// mydomain.com/website.
  • Move all your Wordpress files and folder to /website folder and but do not move .htaccess and index.php file. Leave both these files in root directory.
  • Open your index.php file which is available in root directory and then replace below link:
Code:
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
with this code line.

Code:
require( dirname( __FILE__ ) . '/mywebsite/wp-blog-header.php' );
 
Top