Move WordPress Blog To Main Domain
If you have a WordPress blog incorporated into a static site and now want to run the entire site on WordPress there are many options available. The most common use of WordPress is probably included on a static HTML site with WordPress installed in a directory called blog. After seeing the power and flexibility of WordPress many people want to ditch the old HTML files and run the site entirely on WordPress. There are several options to make this transition and the best method to do it depends on the current settings and your desired outcome. This particular guide will cover the most common situation.
Please read over and fully understand this entire Guide before Implementing!
What we are going to do is, sort of, move the current blog to the main domain or directory, create a static front page for the blog on the main and the blog posts will still be on the /blog directory. This guide will assume you have a WordPress blog installed in a directory called /blog and you are using the postname in the permalink structure. The postname permalink structure is critical to maintaining your current blogs permalinks (the URL’s of the posts). If you have WordPress installed on a differently named directory, other than /blog, just substitute it for blog throughout the transition. This guide is a bit advanced and assumes you have some basic knowledge of directories, FTP and how to edit files on your hosting account, so please don’t ask how to do those basic tasks in the comment section.
First things first and that is a complete backup of all critical files and the database. The only WordPress related files that you should backup on a regular basis are all in the wp-content folder, this has your plugins and themes but most importantly the uploads folder. The plugins could all be downloaded again, and if the theme is not edited or customized it too can be downloaded again as well. But all the images you might have uploaded into different posts are usually stored in the uploads folder. So good luck trying to restore those without a backup! So fire up your FTP client and browse to the WordPress files, and save the entire wp-content folder on your computer.
Next is to backup the database, which is the most important thing to backup. The database holds all the content or the actual posts and settings. Keep in mind that the database will have the settings of the blog in its own directory at this point. So restoring the database with this version of the backup will undo what we are going to do and put it back into the old /blog directory. Got that? Good. There are several different ways to backup the database and since I and many others have written about it I am just going to refer you to those posts here:
Backup WordPress Database
Scheduled Backup Of Your WordPress Blog
So now that you have everything backed up and saved safe and secure on your computer its time to make the move. I cannot stress enough the importance of those backups and I will not be responsible for or will help you (for free) restore your lost WordPress blog or website! And once again this guide is for a very specific situation as stated above, any variation form those may not work for your situation.
Login to the WordPress dashboard and go to the Settings, General panel. In the first box for WordPress address (URI): keep this as is, this is the location of your main WordPress core files. We can still keep these files in the /blog directory but still move the blog to the main domain. In the box for Blog address (URI): change the address to the new location, which in this case will mean removing the trailing /blog and will be the main domain only. Scroll down and Save Changes and do not try to open or view the blog or click any other dashboard menus now! Do not worry about the error message you might see you will probably get a message about file not found.
Next on the hosting account copy the index.php file, and if you have one the .htaccess from the /blog directory to the main directory. Now open (to edit) the index.php file you just copied into the main directory and add the /blog directory to the area below:
Change:
require('./wp-blog-header.php');
To:
require('./blog/wp-blog-header.php');
This is telling WordPress where the files are located which is the same location as the blog was originally. Since the files are still in the same location, so too is the dashboard so you will still login to the dashboard at the same location as before the change.
Next is to rename the old index.html or index.htm files on the main domain or directory. These files will show the old site until renamed or removed. I suggest renaming them so they will still be visible online so you can use them to rebuild your new WordPress front page. So if you rename index.html to oldindex.html you can see it by it’s full address: www.yourdomain.com/oldindex.html. If you don’t see your WordPress blog on your main domain after these steps refresh your browser and or clear it’s cache.
Remember you want to maintain the old blog posts permalinks, and after the move the posts are on the main domain without the /blog in the permalinks or URLs and are now broken. So you need to create a static WordPress front page for the site that will have the information similar to what was on the old HTML site. Go to Pages (not posts) and create a new page. Title the new page the same as your old static index.html page, and in the All In One SEO plugin module add the same keywords and description as well. Add the content to this page that you want shown on the sites main domain. Publish the new page and then create another new page titled Blog, or the same title as the directory the WordPress blog was originally installed in. Add no content to this page and publish it blank.
Next go to Settings, Reading and choose the Static front page option, choose the new front page and the Blog page for the posts page and save changes. Then go to Settings, Permalinks and, without changing them, just click Save Changes to reestablish them once again. Now your old blog posts should be back on the same permalink or URLs as before the move.
Now you can use the WordPress dashboard to run your entire site and can edit the front page in the WordPress page editor. Keep in mind that all your old HTML pages can coexist with WordPress in any directory so you really don’t need to remove them and can keep them live.
I know this is a very long guide and the steps are very specific to this situation and desired outcome. So please be very careful, read over the guide first and make sure you understand what you are about to do before doing it.
Here are a few posts that will help after you make this move:
Create A Custom WordPress Static Front Page
Change Static HTML Page Into A WordPress Page
Remove Title From WordPress Page Template
Similar Posts:
- Clean Up WordPress Database
- Add Comments To WordPress Pages
- Fix AdSense Deluxe For WordPress 2.8.1
- Remove WordPress Blog Title And Description
If you liked this post, feel free to leave a comment that is relevant to the post or subscribe to the feed and get future articles delivered to your feed reader.
Sorry but due to the spamming of a few all comments are moderated and will appear when approved and all drive-by comments will be deleted!











Comments
I also decided to put WordPress on my root. Matt Cutts said not to – even though he’s a really smart guy I have to disagree with him on this one. Putting WordPress in our root is just so much better for usability purposes. People don’t have to click twice to get to where they need to go.
I also back everything up in my text editor notepad light- just to be sure I won’t lose anything.
I put the
Title:
URL:
date I posted:
under which category:
That way there is no way of losing all my work.
Thanks for this.
All the best,
Eren
Reply
Notebook Replied:
July 28th, 2009 at 1:11 am
Yes, I agree with you, put wp on root is better than the subdomain as it will be more effective for new visitors. I guess Matt just drunk, lol
Reply
Is it not harmful to move your word press blog to a main domain. Will it have any negative effect on the site, i.e will the link juice will go or will it be retained?
Reply
Jeff Replied:
July 5th, 2009 at 10:57 am
I was wondering how long it would take for someone to read just the title of the post and comment without reading or understanding the details.
If you read the entire post and understand it you will realize that the blog virtually didn’t move. It is still in the same /blog directory and I thought that most people who read that the post’s permalinks are maintained would realize that. Yes the blog is sort of moved but what actually happens is the main domains is replaced with a static WordPress page and the blog posts are moved to a page called blog. Placing the blog right back where it was to begin with.
Reply
Thanks alot for this!.. I was always wanting to move my site, but was very scared in doing so.. but now after reading this, i’m good with it. cheers.
Reply
Good information, I have a customer in the process of doing this right now – so this will simplify things.
Reply
i just start thinking to make blog with wordpress, now i have two blogs using blogger.com, i chosed blogger because it more simple than wordpress but now i found that WordPress provides more features than blogger
Reply
nice tutorial i think this could help a lot of people change stuff up a bit, when you get a blog started and you began on a free hosting site you want to move after you become successful to take the next step but you don’t want to lose any info. this is great thanks.
Reply
Yes definitely “Roshi” has not read the whole post and he has just commented on it. The post is exceptional it clears each and every doubt in mind. Definitely i am going to try it on my site.
Reply
A very comprehensive guide, you really summed it all up nicely. This is one of those things that I knew I’d have to get to eventually, but it took so much work (or so i thought) that I postponed it again and again. Now I finally can do it, with a step by step tutorial
Thank you so much!
Reply
I wish I had come across this article before recreating my wordpress.com blog on my domain. Well, now I will know.
Reply
Thanks Mister, i must read all your articles here, i will remake my wordpress in my domain, just spend my time to learn all. now , i just can say , Thank you !
Reply
I recently moved my blog to my own domain – wish I would’ve had these steps initially, as it would’ve made the process somewhat easier. I was categorically worried about losing linkjuice initially.
Reply
A very comprehensive guide. Nice post..
Reply
Thanks for giving us the idea for moving the blogs into the site format in fact many ones dont know about this trick or say the idea!once again thanks!
Reply
Awesome post. This is extremely relevant to me right now. Perfect timing. I will definitely use this as a primary resource.
Reply
wow..nice tips…
now i hope i can move my wordpress blog…
Reply
A very comprehensive guide, you really summed it all up nicely.
Reply
Nice post….I just want to move my gadget blog. Thank God I read your post.
Reply
Good information, Definitely I am going to try it on my site.
Reply
Hi,
I was just wondering if its possible to run your whole site on WordPress as a CMS and then run a part of it as a blog in xxxxxx.com/blog ?
Or do I have to install 2 versions of wordpress with 2 different databases to acomplish this?
BR,
Tjäna
Reply
Jeff Replied:
July 19th, 2009 at 11:53 am
This post explains exactly that, did you actually read it?
Reply
Thanks alot for this!..
Reply
thanks for the tips, i am trying out wordpres
Reply
Great and thorough guide. I have only been using wordpress for a month or so now but I love it. It is so much simpler and easier to use than many other content management systems.
Reply
Thanks for the tips. I am also interested in using WordPress for my website. The main page of my site will have more updates if it is in a blog format.
Reply
Great guide Jeff. My first time here as I am helping a friend sort his blog out and this information is just what we were looking for. Cheers, Andy.
Reply
[...] Move WordPress Blog To Main Domain [...]
Hi Jeff, thanks for the great tips. I have successfully moved my blog to my own domain. Helps a lot to have read your post.
Reply
Thanks for the lesson and guide, i already moving my wordpress. Thanks again.
NIa
Reply
Great tutorial Jeff. Very clear, I followed it to the letter and it worked great. Or so I though. It’s fine in Firefox but in IE when the site is first opened it’s fine, opening on the new static page. But then when you click on the Blog page, the blog opens OK but then click on Home again and it won’t display the static page, it ‘sticks’ on the Blog posts.
Try the site in my sig in IE to see what I mean.
Any ideas?
Dave B
Reply
Jeff Replied:
October 2nd, 2009 at 7:16 am
Not really Dave, it might just be a cache issue on the IE browser, try clearing your cache?
Reply
DaveB Replied:
October 2nd, 2009 at 7:33 am
Thanks for the reply Jeff. I cleared my cache but that doesn’t solve it. My partner thinks we’ll have do a full domain to domain transfer only just between the /blog folder and the root to install it fully on the root.
Obviously, no-one has reported this problem before.
If we find a solution I’ll report back here.
Thanks again.
Dave B
Reply
Leave a comment
Drive-By comments will be deleted! Like "Thanks for sharing", "Nice post", or any other text that doesn't contribute to the discussion. If you ask a very specific question about your particular WordPress theme, it will probably be deleted. I can fix your WordPress site but for a price. If you ask a question like "Why don't my blog work right", it will be deleted. If you ask a question about your WordPress site without a leaving a link to it, it will be deleted. The point is to ask questions and or comment on the the actual content of the post, and to please use some common sense. All comments are moderated and will appear when approved. Thank you.