Finish Moving Your Blogspot Blog to Another Host with Link Rel Canonical Tags

In the first part of this two-part article, you created the complete list of equivalent URLs between your Blogger-hosted blog and your new domain. In this part, we will continue with the rest of the steps we need to take to move the blog, and you will learn how to dynamically add a link rel canonical element to your Blogger template source code in such a way that it conforms specifically to the standard set in part one.

Third Step: Convert your Blogger Classic Template to be XML-based (optional)

Later, you will implement Blogger scripting codes that won’t work with the classic Blogger templates. So if you are using a classic-based Blogger template, you will need to convert it to an XML-based template using the following procedure:

1. Log in to your Blogger account : http://www.blogger.com/

2. In the Dashboard, click “Template.”

3. At the top of the template menu, click “Customize Design.”

4. Click “Upgrade your Template”.

5. You will then be asked to select a new template for your blog. Select those that are closest to your current template. Then click “Save Template.”

Your blog is now converted to the new XML-based Blogger templates. Of course, you can skip this step if your blog is NOT based on a classic template.

Often bloggers are confused when determining whether their blog is New XML- based or Classic-based. It is relatively easy to determine. Follow the steps below:

1. Log in to your Blogger account.

2. Look carefully for your blog in the dashboard and compare it with the screen shot below:

If what you see under the blog to be transferred to the new web host/domain uses “Layout,” then the blog already uses a ”New/XML based template.” You will need to skip this step. Otherwise, if you see "Template" under the blog name, then your blog still uses the ”classic” Blogger template and you will need to convert it to an XML-based template by following the steps outlined above.

As specified in the first part of this series, you will only be transferring the content of Blogger post URLs. So the rest of the Blogger URLs, which are called “archives,” will need to be tagged with Meta No Index. This is necessary for two reasons.

First, you will not need to move them to your new domain. There is no “direct” equivalent to the archived URLs that will be found in the new domain under the new web hosting.

Second, you will not need them to be indexed by Google anymore, because if they are indexed, it will create a duplicate content issue with the content found in your new domain.

Therefore, the <meta content=’NOINDEX’ name=’ROBOTS’/> tag should be placed in the <head> tag of the Blogger template. However, if you directly paste that code in the Blogger template source code, all URLs, including the post and front page URLs, will be also tagged with <meta content=’NOINDEX’ name=’ROBOTS’/>, which is NOT a correct implementation.

Since you only need to tag Blogger archives with the meta noindex, you must use Blogger scripting. Copy and paste the code below next to the <head> tag:

<b:if cond=’data:blog.pageType == &quot;archive&quot;’>

<meta content=’NOINDEX’ name=’ROBOTS’/>

</b:if>

So that it will look like this:

This conditional tag: <b:if cond=’data:blog.pageType == &quot;archive&quot;’> means that if the URL is an archive, then the meta noindex tag will be outputted as part of the <head> tag HTML.

Important note: Before pasting the code below, you need to ensure that there is no other link rel canonical tag in the Blogger XML-based template. There should only be one link rel canonical tag in the source code which is coming from this tutorial. To double check and to remove any existing link rel canonical tags, follow the steps below.

1. Log in to your Blogger account.

2. Click the ”Layout” link in the Blogger dashboard corresponding to the blog being worked on.

3. Click the “Edit HTML” link in the header navigation menu under “Layout.”

4. You will then be presented with a source code under “Edit Template.” In the source code area hit control-A to select all, then control F.

In your browser find box, paste the word "canonical" (without quotes). If the browser returns nothing, there is no other link rel canonical tag; otherwise, remove it from the template source code template.

You can use the technique illustrated in the fourth step when looking for conditional Blogger tags to match certain criteria. An important criteria that needs to be matched in this step is the “front page URL.” For example:

<b:if cond=’data:blog.url == &quot;http://webdevelopmentexperts.blogspot.com/&quot;’><link href=’http://www.php-developer.org/’ rel=’canonical’/></b:if>

In the above code, it says that if the requested URL is equal to http://webdevelopmentexperts.blogspot.com/ then return the link rel canonical code in the <head> tag:

<link href=’http://www.php-developer.org/’ rel=’canonical’/>

Of course, it is pointing also to the home page of the new domain, which is the equivalent of the Blogger front page URL.

Place the code next to the conditional meta no index tag in the fourth step, such that the code arrangements will be:

<head>

<b:if cond=’data:blog.pageType == &quot;archive&quot;’>

<meta content=’NOINDEX’ name=’ROBOTS’/>

</b:if>

<b:if cond=’data:blog.url == &quot;http://webdevelopmentexperts.blogspot.com/&quot;’><link href=’http://www.php-developer.org/’ rel=’canonical’/></b:if>

You have just completed two important tasks:

1. Putting the meta no index tag on the Blogger-archived URLs.

2. Setting up the link rel canonical tag for the Blogger front page URL so that it points to the home page URL of the new domain.

However, you still need to place link rel canonical tags for the rest of the Blogger post URLs so that they point to their equivalent URLs in the new domain. The number of link rel canonical tags depends on the number of Blogger post URLs.

For example, in the spreadsheet in part one: http://www.php-developer.org/wp-content/uploads/tutorials/Title_Tag_Vlookup_to_GET_Equivalent_URLs.xls , there are a total of 53 Blogger post URLs, excluding the home page, which was already completed in the fifth step.

So this means that there are 53 additional link rel canonical tags that need to be added to the Blogger <head> section of the source code. Of course if your Blogger URLs are few, you can do these things manually by replacing the URLs with the Blogspot URL and its equivalent URL in the new domain.

But things can get quite complicated if you have hundreds or thousands of Blogger posts. If this describes your situation, you need to automate the process using an MS Excel spreadsheet.

Remember that you have already completed the spreadsheet containing the complete paired listing of Blogspot and its equivalent new URLs in the new domain. This was done in step 2 (in part one of this tutorial, link to example spreadsheet provided above).

You are going to use that data to automatically determine the link rel canonical tag. In MS Excel, a clever function like CONCATENATE can make these things very easy.

If the Blogger URL and the Equivalent New Domain URL are the only variables, then all of the elements in the Blogger link rel canonical script are constants.

To develop the formula in MS Excel, let’s start with the first row (you can then copy and drag the formula to any rows you need). Suppose the following:

Cell A2(variable) => Blogger URL first entry

Cell B2(variable) => Equivalent URL in the New Domain of Cell A2

By the way, column A and Column B in MS Excel are taken from the data resulting from step 2 in part one of this tutorial. .

Cell C2 (constant)=> <b:if cond=’data:blog.url == &quot;

Cell D2(constant) => &quot;’><link href=’

Cell E2(constant) => ‘ rel=’canonical’/></b:if>

Therefore, the final link rel canonical script outputted in Cell F2 is a combination of Cell A2 to E2 using concatenate function:

=CONCATENATE(C2,A2,D2,B2,E2)

If this seems too complex to imagine, download this link rel canonical automation Excel template: http://www.php-developer.org/link-rel-canonical-automation-excel-template-for-blogger/

Extract the file in the zip archive and then open the spreadsheet (requires MS Excel or Open office Calc).

Now, using the data you have processed in step two, part one of this tutorial,  copy and paste the Blogger URLs to column A while the equivalent URLs in the new domain SHOULD be in Column B (do NOT ever interchange them or distort the pairing). Since the front page URL was already completed in the fifth step, exclude it from the data.

IMPORTANT: To paste the data “safely” into MS Excel, you can use Paste Special, then select ONLY text option.

The processed data will now be look like what you can see at the following link: http://www.php-developer.org/wp-content/uploads/tutorials/filledindatalinkreltemplate.jpg

Now select all of the resulting link rel canonical script in Column F (all rows which are not empty — if you have 53 URLs, then there are 53 rows to be selected). Copy and paste it to a text editor such as notepad. It will then be look like this (please unchecked the wrap text option in notepad): http://www.php-developer.org/wp-content/uploads/tutorials/pastedatnotepadscreenshot.jpg

The sixth step is complete.

The last and the most important step is to finally paste the link rel canonical script created in the sixth step to the Blogger template source code below the front page link rel canonical tag:

<b:if cond=’data:blog.url == &quot;http://webdevelopmentexperts.blogspot.com/&quot;’><link href=’http://www.php-developer.org/’ rel=’canonical’/></b:if>

Paste in the remaining link rel canonical script for the Blogger post URLs pointing to the new domain URLs. After pasting this, it should now look like this:

Finally, hit “Save Template.” And now, using a browser, open any of your Blogspot post URLs, and then view the source code. It should contain a specific link rel canonical tag in the <head> tag that contains that specific Blogger post URL pointing to the equivalent post URL in another domain using a different host.

It will take at most three to six months for Google and other search engines to mature the transferring of page and link properties to the new domain. You will then notice that the new domain will replace the previously ranking Blogspot URLs.

Of course, if you need to update your blog, such as by adding content, you should update your new domain and never touch the Blogger-hosted blogs. Below is what you should do:

a. Do not delete your Blogger-hosted blogs.

b. Do not update your Blogger-hosted blogs anymore; instead, update your new website.

c. Do not worry about contacting your partners to change their links. The link rel canonical tag will do everything to transfer the link properties to your new domain.

Google+ Comments

Google+ Comments