Posted In Tutorials

Building WordPress Outside of the Root Folder for Development

We use WordPress as a Content Management System constantly here at J Taylor Design. There are many perks to using WordPress that can help to make your site search engine friendly, as well as really easy to update and maintain. In most cases, if we’re moving the hosting of a client, we just build the new WordPress site in the root folder of the new host, then push the site live when we’re all finish. That’s really nice as we don’t have to worry about there being issues with transferring the site and making sure everything is hooked up properly, as it should be ready to roll out of the gate because we built it right on the platform.

However, sometimes we need to build the sites in a development folder as we’re not moving the host, or we’re redesigning an existing clients site on our hosting platform. In those circumstances we setup a development folder within the root folder and build from there. For example, or

There, we can setup WordPress which will recognize the folder in which it’s installed as the main URL for this site. So if I setup WordPress at, then WordPress uses that address as the main site address. So now we can work and do everything we need to do in the background while the existing site is up and running, and no one visiting the site knows the difference. When we’re all finished and we’re ready to transition between the new site and the old site, this is where the semi complicated steps come into play. It’s not so much complicated, as it is attention to detail. We apologize for this being such a text-heavy post, but there’s not too much we could do with imagery to explain the process, so if you’re finding yourself confused, let us know if the comments or contact us from our ‘Say Hi’ page.

Build Out the Site in the /develop folder

This step is easy as you just do your work as usual. Setup WordPress in a /develop folder and get it finalized and ready to go live.

Getting into phpMyAdmin

Next, we need to log into phpMyAdmin to export out the WordPress database that we’ve just been developing. We do this by making sure we select the database in phpMyAdmin, going to Export, making sure SQL is selected from the Export settings, choosing Save as File and hitting the Go button. From there, phpMyAdmin will export us out an SQL file of the entire WordPress website.

From there we want to open up that SQL file in our favorite code editor, ours being Coda and search for the WordPress URL that we have as our main URL. In this example it’s You can search with the http://www. but just in case you have anything in the code without the http:// or the www. we want to make sure that you replace everything where the .com/develop is located. Once you do that you can save your SQL file with the changes and your ready to import the database back into phpMyAdmin.

Our preference is that we develop using a database called ‘develop’ and then import our newly updated database into a brand new database. The reason being, is that just in case something goes wrong, we can crosscheck our new database, with the development database that we know works because it’s been tested within the /develop folder.

So to do that, you need to setup a new database, then go back into phpMyAdmin, select that new database and go to Import. From the import panel, you want to choose your updated SQL file that we’ve updated and hit Go and let it upload.

Out with the Old

The next step is removing the old site and replacing it with WordPress. Now here you can either move the files on the server from the /develop folder into the root folder, or copy the files to keep the /develop folder intact… Again, leaving the original folder intact allows you to crosscheck your files in case something goes wrong in the root folder. Also, before completely deleting the original website, you may want to back it up somewhere on your computer first, again, in case something goes wrong. Also, we typically create a new folder in the root folder and drop all of the original website files into it before moving WordPress into the root folder.

If you are copying over the entire WordPress install, the most important part is to bring the wp-content folder as that is the folder which stores your theme, plugins, and image uploads.

So once you move out the old files and bring in WordPress, you’re almost finished. The last thing that you have to do before making sure everything is hooked up properly is open up your wp-config.php file in the root folder, and change the database name from development database to your new database. From there, you’re ready to check out the site and make sure everything is running properly.

Some Troubleshooting Tips

  • It may be best to put up a temporary index.html file to keep the site hidden as your making the transition. However, please note that some servers don’t view HTML files over PHP files and you may have to add ‘DirectoryIndex index.html’ into your .htaccess file to tell the hosting that it should recognize an index.html file over other files
  • We’ve run into the permalinks not working sometimes when moving the site due to the .htaccess file moving. If that happens, you can re-save the permalinks in WordPress. You may have to delete the .htaccess file and let WordPress remake it for you.
  • When using certain plugins (ie: some SEO plugins) that you don’t necessarily need to be installed in the development site, wait to install them until you’re working in the root folder. This tip doesn’t apply for the SEO plugins that adjust the title and meta information as that will carry over in the SQL database.
  • With a lot of CMS systems running on PHP and MySql, similar steps may apply as well.

Have We Missed Anything?

If we’ve overlooked a step or if you have any additional tips to help people out, let us know.

Spread The Word