How to Make a Duplicate Copy of Your Wordpress Blog Offline
Ever wonder how you can install an offline copy of wordpress in your local computer? Or better yet a duplicate offline copy of your server hosted wordpress blog?
I’ve been tweaking my wordpress blogs mostly online for months now until I discovered a way that’s much easier, faster and downright efficient. And I prepared a comprehensive guide here for you to get started.
There are many reasons why you might want to do this. Reasons such as…
- Testing new templates and editing CSS files
- Testing new plugins before implementing them online
- Using it as an offline editor (watch out for my separate tutorial on this)
- You are new to wordpress and you just want to test it out
- Or you just want to use wordpress as an offline diary.
So here’s how it goes.
First the tools…
There are two basic files you need to download to get your offline wordpress started.
- Download XAMPP which allows you to create your MYSQL Databases and implement PHP in your local system. You don’t need the full version (even though it’s free) the Lite version will do.
- Download the latest version of Wordpress.
Step 1: Install XAMPP
Depending on the XAMPP version you downloaded the the installation process can be a little different.
If you downloaded the installer you just need to run it and follow the installation instructions. If you downloaded the ZIP or Executable Archive version you need to extract the contents to the root directory of your drive.
NOTE: I did this in Windows if you are using a Mac, Linux, or Solaris check out the respective installation procedures at the XAMPP website.
I think it is also safe to extract the files to other directories other than the root though I have not tried this installation. In my own local system it’s in the C:\ drive.
Once extracted go to your XAMPP installation directory C:\xampplite and look for the file setup_xampp.bat and run it. A command window will appear and run the set-up process ending with an instruction for you to press any key to continue.
You now have XAMPP installed.
Step 2: Run Apache and MYSQL and configure XAMPP
Look for the file xampp-control.exe in the XAMPP installation directory and run it to view the control panel.
Make sure the Apache and MySQL services are running properly. You can opt to close this window now after checking that both services are running.
Next is to open you web browser and type in localhost in your browser’s address bar. Select the appropriate language from the page that will appear.
At the welcome screen click on phpMyAdmin to start creating your database.
NOTE: In some instances you might want to change the security settings to include your own password, the default installations use root as a username and no password. This is really optional but if you are concerned about security or are afraid someone might tinker with your WP installation you can view the security tutorial from the XAMPP website.
Step 3: Create your database
In the phpMyAdmin control panel create your offline wordpress database. Example in the image is wpdata you can name it as you want.
Once you hit the create button your database is now created. And then we proceed with the wordpress installation.
Step 4: Install Wordpress
Installing wordpress involves several steps so read this carefully. Begin by extracting the zip file to the htdocs directory in your XAMPP installation folder. In our case it’s C:\xampplite\htdocs the installation will install a folder named wordpress in the directory which you should rename after your site or whatever name you want.
After extracting, open the file wp-config-sample.php located in the directory where you just installed wordpress (you can use notepad to open the file). Edit the database information with your database name, username and password. If you edited the security setting in XAMPP this is where you place your password.
Save this file as wp-config.php.
Head on to your browser and type the following in your address bar http://localhost/yourblogname/wp-admin/install.php replace yourblogname with the name of the folder where you installed wordpress.
Wordpress will ask you for your site name and the email address enter it and click install wordpress. Your wordpress username and password will then be shown to you, remember them.
Click next to proceed to the wordpress log-in screen, enter your username and password and you have now completed your offline wordpress installation. You will now be redirected to you wordpress dashboard.
If you just need a fresh offline wordpress installation you can end here but if you want to duplicate the content of your existing blog then let’s proceed to the next step in our process.
Step 5: Backup you blog database
It’s recommended that you install the plugin WP-DB-Backup which you can download for free or install within your wordpress dashboard.
Setting for the backup process is accessible from within the tools menu in your dashboard.
The plugin will give you different options. I suggest you backup only the core files and then choose the option to download it to your local drive. Once completed you will have a backup of your entire online database in a zip file downloaded in your local drive. Let’s load it up to your offline wordpress installation.
Step 6: Loading your database
Head back to the phpMyAdmin panel by typing in localhost in your browser window and accessing the phpMyAdmin link in the welcome page. (refer to the photo in step 2)
Click on the database you created and then the import button at the top menu.
In the File to Import section locate for the backup database you just created in step 5 and click Go. If all is well there should be no error and you have just completed the installation of the local copy of your online blog.
Step 7: Tweak your database
There are three important tweaks you need to do in your local database at this point. So far the local wordpress installation you have still points to the online version of your blog http://www.yourblogname.com and we want it to point to the local copy http://localhost/yourblogname.
To do this you need to edit two items in you local database. Select your database from the phpMyAdmin panel and select wp-options
You will be presented will all the options in you WP installation but what we are looking for are three items siteurl, home, and upload_path.
Locate them and replace the values with the following:
- siteurl = http://localhost/yourblogname
- home = http://localhost/yourblogname
- upload_path = c:\xampplite\htdocs\yourblogname\wp-content\uploads\
Step 8: Tweak your files
Now I’m not sure if this will apply in your case or not but I have had some reports that you need to modify two files in your xampp and wordpress installation so that you can make your pages display properly. So I recommend you follow these steps as well.
First, open the file named c:\xampplite\apache\conf\httpd.conf in notepad and look for the line that says LoadModule rewrite_module modules/mod_rewrite.so now if there is a # sign infront of it make sure to delete the # sign and save the file.
Second, open the file c:\xampplite\htdocs\yourblogname\.htaccess and look for the line that says RewiteRule . /index.php edit it so that it is written as RewriteRule . /yourblogname/index.php and then save the file.
Your offline copy is now complete. You can log-in to your offline wordpress site by typing in http://localhost/yourblogname in your browser and use your online username and password to log-in to your dashboard.
Step 9: Final Step
If you want to use the same theme from you offline site just copy your entire theme folder to C:\xampplite\htdocs\yourblogname\wp-content\themes and you’ll have an exact duplicate of your online blog.
I’d like to give credit where credit is due. Special thanks to David Tan of Davidtan.org and Alex from Lifespy.com for their equally informative tutorials on this subject though I felt the need to combine both their ideas into one full length guide with graphics that the average beginner could follow.
Hope you enjoyed this tutorial! Feel free to add your comments.
Charlie Aquino
Internet Entrepreneur
Popularity: 51% [?]
No related posts.






I think Im 99% there with this. I can log in at the localhost/myblogname and I get my admin screen with my backed up info, but when I click on the “visit site” from the admin page, I just get a blank screen. Any thoughts?
Hi Brian,
You might want to try this out and see if this solves the problem.
Open the file c:\xampplite\apache\httpd.conf in notepad and remove the leading # sign in the line that says “LoadModule rewrite_module modules/mod_rewrite.so” then save it.
Next open the .htaccess file in your c:\xampplite\htdocs\myblogname\ folder and make sure the rewrite rule is written this way “RewriteRule . /myblogname/index.php” (without the quotes).
Heard from some people that this fixed a similar problem let me know if this fixes yours.
Thanks!
charlieaquino,
perfect, thank you! it was the /myblogname/index/php that did the trick. I really appreciate your help!
Great Post! Thanks (Why I cant subscribe to your feed? I keep getting an error)
You’re welcome. Glad to be of help.
Hi. I like the way you write. Will you post some more articles?
Cool!
Thanks for feedback on the feed. It should be working now.
Thanks! Thanks! Thanks! Great post, it’s working.