Recently I had to manage an exodus of Blogger driven posts to this WordPress blog. During the move I learned a few new things, developed a few pieces of code, and thought it might be a good idea to share my experiences. Probably there are other bloggers who want to leave blogspot.com but don’t do it because they are afraid of the aftermaths.
Such a move comes with pitfalls and unavoidable traffic losses, so here is my try to minimize the downsides which you please don’t read as kinda move-Blogger-blog-to-WordPress-guru tutorial.
Loading WordPress with Blogger posts and comments
After installing WordPress on this brand new domain, one of my first steps was to feed it with content, and to announce this content to search engines. Search engines don’t care to index posts totally fucked up due to formating issues, but every indexed URL is an asset I can fine tune later on. I figured that Google would need at least a week or so to index the whole blog and didn’t care much about the other engines, which never sent much visitors to my pamphlets. This week gave me enough time to find the broken pages and to remove PRE tags and HTML comments causing the mess.
I’ve imported my Blogger posts and comments into WordPress using the standard import functionality. Pretty neat script by the way (if it can’t access the Blogger database, look at this plugin). Without even looking at the imported stuff I created an XML sitemap and submitted it to Google (you should submit it to Yahoo! too). In the sitemaps settings I’ve disabled the archives because I really don’t want any engine to index them. Then I created a robots.txt, blocked the archives, and added the sitemap autodiscovery statement so that Yahoo!, MSN and Ask can pick up my new blog too. Replacing the uncrawlable archive pages I’ve created categorized links pages like this one later on.
Now I needed to connect my old blogger posts to the new canonical URLs in order to route the human traffic as well as crawlers to the right pages.
- Here are six technical bits which could be helpful:
- The first step was getting the mappings from the blogspot URLs to the new pages. Extracting this info from formatted sources was no option, so I connected to my WordPress database and submitted this query to get the raw data:
(ID #1 was the generated welcome post, and #175 was the ID of the last post imported from Blogger)
LEFT OUTER JOIN wp_postmeta ON (wp_postmeta.post_id = wp_posts.ID)
WHERE wp_posts.ID > 1 AND wp_posts.ID < 176
AND wp_posts.post_status = 'publish'
AND wp_posts.post_type = 'post'
AND wp_postmeta.meta_key = 'blogger_permalink'
ORDER BY wp_posts.ID
- Next I wanted a flexible and persistent data source to make use of the Blogger-URL relations for various purposes, so I created a routing table (joins are too expensive, VIEWs were introduced by MySQL 5.1 and I run an older version) to store the URL mappings (Blogger to WordPress) and populated it from the query above:
CREATE TABLE IF NOT EXISTS `wp_blogger_url_maps` (
`bum_id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`post_id` BIGINT( 20 ) NOT NULL ,
`post_title` VARCHAR( 255 ) NOT NULL ,
`post_name` VARCHAR( 255 ) NOT NULL ,
`guid` VARCHAR( 255 ) NOT NULL ,
`bum_blogger_rel_url` VARCHAR( 255 ) NOT NULL ,
UNIQUE ( `post_id` ) ,
INDEX ( `post_title` ) ,
INDEX ( `post_name` ) ,
INDEX ( `guid` ) ,
INDEX ( `bum_blogger_rel_url` )
CHARACTER SET utf8
Of course you should do that with a script written in a way that you can repeat this procedure. While you’re working on your new blog you’ll still post at blogspot, and visitors will comment. Also, the search engines need to pick up your new blog and that takes a while, so no rush at all.
Please note that when you perform repeated Blogger imports into a WordPress database which stores imported Blogger posts already, new comments to old posts lose their connection to the post and get assigned to the blog’s main page. There’s no official way to move a comment from there to the post it belongs to. So better copy these comments manually, that’s doable with Better Comments Manager, where you can reply from the comments list and edit the author. However, it may be a good idea to do the final import as one of the last steps to prevent you from too many manual tasks like that.
Unfortunately the WordPress Blogger import does not change links pointing to blogspot URLs in your posts. I’ve parsed the post_content column for these links as well as image locations at blogger.com and created a list of posts to edit. It is possible to automate that further, at least for the links to other posts, but I had to edit many posts due to formatting issues anyway and didn’t link much to my other posts, so I did that manually (respectively will do over time). It makes sense to parse the imported posts for HTML comments and PRE tags which work fine with Blogger but can break the layout under WordPress.
- Here are a few ideas what one can do with such a mapping table. To accomplish it you need a plugin that allows the execution of PHP code within the content of posts and pages.
Looping the wp_blogger_url_maps table you can create for example an index page of all imported blogspot posts and their new locations.
Or you could write a mapping tool which delivers new URLs and ask your friends to use it to update their posts linking to you.
- What you really should do is writing a redirect script to “link” from your old blogspot posts to the new URLs. Make sure that the redirect code is 301, not 302! If you only set the location you get an unwanted 302 redirect:
@header(”HTTP/1.1 301 Moved Permanently”, TRUE, 301);
Say the script is http://sebastians-pamphlets.com/blogspot.php and accepts an input variable
srcused to locate the new canonical URL. In your blogger template’s post section you can add this link a while before you move, so that search engines become comfortable with the new locations:
<em>posted by <a href="http://sebastians-pamphlets.com/blogspot.php?src=~(Remove the “~\n” when you copy the code!)
<$BlogItemPermalinkUrl$>"><$BlogItemAuthorNickname$></a> @ <a href="<$BlogItemPermalinkUrl$>" title="permanent link"><$BlogItemDateTime$> · PERMANENT LINK</a></em>
Another possible issue you might solve with these links is that you can transfer the source bonus in search engine indexes from the old posts to the new URLs. One indicator used by the engines to figure out which one of two identical page contents is the source is an unidirectional link. The major search engines do that silently, Technorati even documents it with “NEW URL !” as the linked post title (of the old location) when you put a textual hint like “moved to” or so on the old pages.
- Later on when you actually move you should change the nickname link to your new blog’s root index page, and put the redirect script in the permalink’s href. Then insert a robots meta tag “noindex,follow” in the blogger template and add prominent links to the new URLs to each post.
Monitor the traffic on blogspot (use any free blog stats package or tools like MBL). When most visitors populate your new blog and the search engines have indexed it completely, you can redirect all blogspot URLs to your new address by inserting a zero refresh redirect meta tag:
<meta http-equiv=refresh content="0; url=http://sebastians-pamphlets.com/about/sebastianx-blogspot-com/" />
That will transfer PageRank as well as human visitors to the URL above. It does not route directly to the posts the visitors expected to see when clicking a link on another blog or a SERP (in the HEAD section of the blogger template the variable
<$BlogItemPermalinkUrl$>is not yet populated with the permalink so you’ve to use a hard coded URL in the meta refresh directive).
The redirects from blogspot to my blog come with disadvantages because it’s not possible to map each and every URL to a corresponding page on this site. From a few pages like archives and so on I can link out to my exodus page or the root, but can’t map a post-URL or so. So I’ve not yet decided whether I’ll do the final redirect or not.
Of course it would transfer the PageRank from my old blog to this site, but it certainly would confuse visitors who click a link to any post on blogspot and land on the exodus page or the main page here. I guess that’s a sure-fire procedure to lose visitors. I tend to leave the ugly blogspot thingy as it is now, plastered with links pointing here. I’d rather miss out on a few folks who read my old stuff at blogspot and don’t click through to this blog, than piss off way more visitors with a zero meta refresh. Also, the old blog’s main page only showed a toolbar PR 4 and I’m not afraid to write that off, especially because the very nice folks linking to me in their blogrolls have changed the URL already, and a few friends have even edited their posts — THANKS!– linking to me.
- Redirecting folks consuming my stuff in their feed readers was quite easy. I’ve burned this blog’s feed with Feedburner’s MyBrand (free, you get a feed URL like http://feeds.sebastians-pamphlets.com/SebastiansPamphlets). When I was ready to move my still buggy blog I wrote a farewell Blogger post, waited a day to reach most if not all readers, then I redirected my old blogger feed to feedburner resulting in a nice spike (from zero to 150 subscribers) in my Feedburner stats. In Blogger go to Settings/Feed, enter the new feed’s URL and you’re done. You can do that without burning your feed too, but then you miss out on the stats.
Well, a few days after the move everything runs smoothly and as expected. Google has indexed and ranked 60 pages and still counting, I spotted my very first SERP referrer, and the number of indexed pages from blogspot.com decreases slowly caused by the noindex robots meta tag. The other engines are still crawling, only Yahoo has indexed 3 pages and 100 inbound links so far. StumbleUpon users liked my not that serious canonical SEO definitions and created more buzz than Sphinn so far. I feel lucky.
My to-do list is here and if you’re interested in my scripts drop me a message in the comments.
Share/bookmark this: del.icio.us • Google • ma.gnolia • Mixx • Netscape • reddit • Sphinn • Squidoo • StumbleUpon • Yahoo MyWeb
Subscribe to Entries Comments All Comments