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



Comments
Tags: ,

WordPress Theme Editor Additions

For those of us, myself included, who are always tweaking WordPress themes from within the WordPress dashboard, there have been a few changes/additions to the WordPress dashboard theme editor.

Read This Post…



Comments
Tags: ,

Does The WordPress Automatic Upgrade Feature Work On Your Hosting Account

There has been an automatic upgrade plugin for WordPress for quite some time now. And since WordPress version 2.7 the automatic upgrade feature has been part of the WordPress core. But there are some hosting accounts that restrict the automatic upgrade feature from working.

Read This Post…



Comments
Tags: ,

WordPress Version 2.8 Now Available

If you haven’t seen it in the WordPress dashboard yet version 2.8 has been released and is now available. I strongly suggest keeping your version of WordPress up to date at all times.

Read This Post…



Comments
Tags: ,

What To Do With A New WordPress Blog

So you just got a bright shiny new WordPress blog and you are dying to get it it all tricked out and looking perfect right? Slow down there speedy! The first thing to do is ask yourself a few questions and see if you should spend the time or money to get the WordPress blog to look how you really want.

Read This Post…



Comments
Tags: , ,

New Sidebar Widgets Interface In WordPress Version 2.8

Testing out WordPress version 2.8 beta what I liked so far is the new functionality for sidebar widgets. Some may remember the drag and drop function of previous versions of WordPress and now it seems as if the best of old and new will be in WordPress version 2.8

Read This Post…



Comments
Tags: ,

The Difference Between WordPress And Blogger

Probably not a day goes by on a blogging forum somewhere that the question is asked. While you may have figured out where my preference lies. The question of which blogging platform is better may be a bit of a partisan issue. Loyalist on both sides will defend their chosen platform like people defend their political ideology. In my humble opinion a self-hosted WordPress blog is the best option for both beginner and advanced bloggers alike.

Read This Post…



Comments
Tags: ,

Why Your WordPress Blog Might Be Screwed Up

You just made a WordPress post, or maybe you tried to customize your WordPress theme and now it looks terrible. Here are a few things to consider when making a WordPress post or messing around with your WordPress themes files to eliminate any problems.

Read This Post…



Comments
Tags: , ,

Multiple Page WordPress Posts

There may be occasions when you want to split a WordPress post or page into multiple pages. This can be useful and reduce load times if it is a particularly long article or has a lot of images embedded in it. This is easy to do using WordPress.

Read This Post…



Comments
Tags: , ,

Remove Title From WordPress Page Template

There may be certain situations when you will want to remove the title of the page that appears just above the actual content on WordPress pages. The placement and look of the page title is theme specific and you might want to remove it if you are using static front page option or just want a page on your blog that looks a little different than the rest of your WordPress pages.

Read This Post…



Comments
Tags: , ,