ThemeLab's Blog

Stay up to date with our newest WordPress themes, WordPress plugins, WordPress tutorials, and other announcements.

Is it time to move to a self-hosted WordPress?

Last Updated on by

Today I noticed a lot of Blogspot blogs serving up 502 errors, making almost all the Blogspot-hosted blogs I frequent temporarily innaccessible. For a lot of Blogspot users, the image below will look very familiar:

Blogspot 502 Server Error

Don’t get me wrong, Blogspot (a service of Google) is great for some people, and this may just be a hiccup, but do you really trust your blog in the hands of a free service? If you want to have peace of mind in knowing your blog is safe from these unexpected Blogspot outages, and want to make the switch to a self-hosted WordPress on your own domain name, read on.

Step 1: Buy a domain name
If you don’t have your own domain name already, get one. The advantages of hosting on your own domain over a Blogspot URL in terms of SEO (search engine optimization) are undeniable. There are a number of domain registrars you can use to buy relatively cheap domains (usually less than $10 per year). Some recommendations:

  • GoDaddy – This is a very popular domain registrar with an easy to use interface. The phone and e-mail support is also top notch. Try using the coupon code “hash3” to get a discount on your domain registration. The price will be a little more than $7.
  • NameCheap – They are known for their reliability, cheap prices, and easy to use interface. Try using the coupon code “SPRINGDAYS” to bring your price down from $9.29 to $8.41.
  • DynaDot – I’ve never personally used them myself but heard nothing but good things about them and their support.

You really can’t go wrong with any of these registrars. The price may vary slightly, just choose whichever you feel most comfortable with.

Step 2: Get hosting
A hosting company I’d personally recommend is HostGator. Their hosting plans offer plenty of web space and bandwidth, and in my experience – the servers are very fast. Support is very quick to respond as well, which is surprising considering the incredible size of their company. They also have a nifty little tool called Fantastico, which will automate your WordPress installation (along with countless other open source scripts). Of course there are plenty of other suitable hosts out there, just choose whichever you feel most comfortable with.

Step 3: Point your new domain name to your new hosting account
Once you buy your domain and get hosting, you need a way to “point” your domain to this hosting account. This is accomplished through setting something called nameservers (provided by your host) within your domain registrar account. It’s relatively straightforward thing to do, and involves filling in a couple input boxes with 2 (or more) nameservers and submitting the changes. You could see your domain pointing to a blank Index Of / page very soon.

Step 4: Install WordPress
If you chose a host which uses Fantastico or some other automated script installation tool, simply follow the prompts and you should have a fresh installation of WordPress set up in no time. If not, please consult our how to install WordPress post to do it manually.

Step 5: Import your Blogspot blog
Okay, you should have an empty WordPress blog now. Chances are, you’ve invested a lot of time in energy into your blog and don’t want to start fresh. You should probably import your entire Blogspot blog into your new WordPress installation. Fortunately for you, WordPress has a built-in import feature that can login to your Blogger account, grab all the posts, and add them to WordPress. In your WordPress administration panel, select the Manage tab, and then select the Import tab.

WordPress Import

As you can see WordPress can import from a lot of other blog hosting services as well, including their own While importing Blogger posts, you’ll need to “Grant Access” to WordPress to login to your Blogger account and grab all your posts. This process will take a few minutes, depending on the size of your Blogspot blog.

Step 6: Finishing Touches
If your blog is already well-established, you’ll probably want some way to redirect your visitors to your new URL. First thing you need to do is edit the HTML in your Blogspot template.

Add the following code below in your template:
<script language=”javascript”><!–
var blog_root=;
<script language=”javascript”><!–
var process_page=””;
var newpage=process_page;
var oldlink=”<$BlogItemPermalinkUrl$>”;

In between the head tags in you Blogger template, add this:

<meta http-equiv=”refresh” content=”0;url=” />

Of course you’ll have to replace with your new URL.

Now, to prepare your new WordPress blog to accept these redirects and forward them to the corresponding posts, you’ll need to create a new file in your WordPress root directory to do this. We’ll call it blogger-redirect.php. You can rename this file if you want, as long as it corresponds with the URL you defined in the Blogger template. Add the following code to this file and save:

$search_link = $_GET[’p'];
$vars = explode(’/', $search_link);
$num = count($vars) - 1;
$filename = $vars[$num];
$slug = str_replace(”.html”, “”, $filename);
$SQL = “SELECT posts.* FROM $wpdb->posts AS posts WHERE posts.post_name = ‘$slug’ LIMIT 1?;
$posts = $wpdb->get_results(”$SQL”);
if ($posts) {
foreach ($posts as $post) {
$found_link = get_permalink($post->ID);
$found_link = “”;
<script language=”javascript”><!–
document.location.href=”<?php echo ($found_link); ?>”;
<meta http-equiv=”refresh” content=”2;url=<?php echo ($found_link); ?>”>
<p>You can also proceed immediately to <a href=”<?php echo ($found_link); ?>”><?php echo ($found_link); ?></a>.</p>
<p>The main blog URL is <a href=”” mce_href=””></a>.</p>

Remember to replace all the’s with your new domain name. All this code does is try to determine which Blogger post the traffic is coming from, and forwards it to the corresponding page in your new WordPress blog.

And that’s about it. This method of importing not work for some people for whatever reason, but hopefully this article gives you new insight on blogging with your own domain and hosting. Feel free to comment and share if you liked the article!


Leland Fiegel was the original founder of ThemeLab. He is a web developer who loves WordPress and blogging.