Maintain permalinks moving from Blogger to WordPress

WordPress’s excellent import script for Blogger doesn’t use the original post slug—necessary for maintaining the permalinks of imported posts. Instead the importer creates new post slugs based on the post titles, which diverges notably from those generated by Blogger because:

  • Blogger truncates the title much sooner than WordPress (less than 40 characters in length)
  • Blogger excludes English article words (a, an, the)
  • Blogger drops characters with accents, instead of converting them to their closest ASCII equivalent

So for example, a post title like:

Los viernes, música para tu iPod en iPod Noticias

gets dirified by Blogger as:

los-viernes-msica-para-tu-ipod-en-ipod

as compared to what WordPress produces:

los-viernes-musica-para-tu-ipod-en-ipod-noticias

How a title gets dirified is of little importance here. What is crucially important is that the permalink doesn’t change—an issue when moving from one platform to another. The average blogger probably doesn’t care about this too much—but there are some people (myself included) who wouldn’t want all the old links to our blog posts to break, especially when it comes to maintaining that precious PageRank™ (and findability).

When I moved from Blogger to WordPress 1.5, I managed to maintain the permalinks the hard way (just shy of updating every one by hand). These days, the importer is so good, practically all you have to do is click a link and sit back. I wanted the same to be true for the permalinks.

Instructions

  1. First, import your posts from Blogger using WordPress’s built-in importer. Note: This plugin will not work if you export your posts from Blogger and then try to import that into WordPress using a WXR file.
  2. Download and unzip wp-maintain-blogger-permalinks-1.1.zip (v1.1)
  3. Upload the file wp-maintain-blogger-permalinks.php to your plugins directory:
    /path/to/wordpress/wp-content/plugins
  4. Activate the plugin (don’t forget!)
  5. Under Tools > Maintain Blogger Permalinks click the button that says Maintain Blogger Permalinks
  6. That’s all. You can deactivate and delete the plugin if you like. All your permalinks are now updated.
  7. Go to Settings > Permalinks and select “Month and name”
  8. To ensure that your old Blogger URLs ending in “.html” get redirected to your new “.html”-less WordPress permalinks, edit your .htaccess file and put the following above the # BEGIN WordPress block:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)\.html$ $1/$2/$3/ [QSA,R=301,L]
    </IfModule>

    Note: your RewriteBase line above should match the one in the # BEGIN WordPress block already in the .htaccess file.

  9. To confirm that the rewrite rules above are working, take your latest permalink and replace the trailing slash “/” with “.html”, e.g.
    http://example.com/2010/02/my-blog-post.html

    If you paste that URL into your web browser, it should automatically redirect to:

    http://example.com/2010/02/my-blog-post/

That’s it. As always, if you’ve got questions, please feel free to leave a comment or send me an email.

How to set up a JavaScript Redirect

If your current Blogger blog has blogspot.com in the URL, e.g. myoldblog.blogspot.com, then you’ll have to use JavaScript to redirect from your old blogspot URLs to your new WordPress ones. As of September 2009, there is no way to set up a 301 redirect from a blogspot-hosted blog to an external domain (without some creative DNS-wrangling and a lot of patience).

To set up a JavaScript redirect, just copy the following code snippet and paste it above your </head> tag in your Blogger template (under Layout > Edit HTML). Then edit the two lines that say old_domain and new_domain, replacing myoldblog.blogspot.com with your current blogspot domain name and mynewblog.com with your new domain name. Note: If your WordPress blog lives in a subdirectory, e.g. mynewblog.com/wordpress, make sure to include that in new_domain. Save the template and you should be good to go.

<script type='text/javascript'><!--
// edit the text in between the quotes in the following two lines:
var old_domain = "myoldblog.blogspot.com";
var new_domain = "mynewblog.com";

// do not modify this line:
window.location = location.href.replace(old_domain, new_domain).replace(".html", "/");
//-->
</script>

126 comments

name
blog (optional)
comment

Well, am I really the first one to comment, or is this just the weird design?

Anyway, tried everything perfectly, and all I am getting is errors about unexpected [ in pragma. any help?

BTW, I guess this will help me to maintain links to my own posts, right? I mean, if I had a link to http://yuvipanda.blogspot.com/somepermalink, and I import it to wp, I get it as http://blog.yuvisense.net/samepost, right?

Any help? While I am no no-programmin-allowed guy, I am certainly a noob in PHP, so, please help:D

Yuvi, yep, you’re the first. This method is really not intended for blogspot-hosted blogs because blogspot offers no way to automatically redirect a request for an old post to a new location. So the benefit of maintaining a permalink in that case is only superficial. However, if you still want to do that, this method should work for you.

I would need more information about the error you’re getting (when it happens, the exact text, etc) to determine what might be the cause.

Thank you! Question: I have a blogger blog that has three flavors of permalink URLs – some have “.html”, some have “.php” and some have no extension. How might I modify the included script so that I can migrate to Wordpress and still maintain all the permalinks? (could I import them all with no extension then use the “resolve” trick–step 7–to work for both .html and .php urls?)

Scott, in the rewrite rules in your .htaccess file, replace the long last line in the example at the bottom of this post with:

RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)(\.html|\.php)?$ $1/$2/$3/ [QSA,R=301,L]

That should match anything that ends with .html, .php or nothing.

Hi Justin,

Thank you for these suggestions, i’m really interested on keeping the same permalinks but i’m getting this error:

Warning: Unknown modifier ‘]’ in blogger.php on line 412

for each post trying to import. Same error on WP 2.0.4 and 2.0.5, any help?

Fernando, oh shoot! You found a bug.

Unfortunately it’s because WordPress has a bug that causes it to remove backslash characters (\) inside <pre> blocks. I usually get around this by escaping the blackslash with &#92;, but it appears that I missed one in the regular expression on line 412.

If you change your updated line 412 to

preg_match("/([^\/]+)\.html$/", $postinfo[6], $matches);

… that should fix it.

Thank you for the very helpful comment, as this appears to be what was impeding Yuvi.

Justin,

I don’t know regular expressions but i found something that seemed to work too.

I changed line 412 for this and it worked:

preg_match(“/([_A-Za-z0-9-]+)\.html$/”, $postinfo[6], $matches);

Of course your solution looks better ;-)

I’m going to import it again to be sure, thank you for Suicide! ;-)

thank you for Suicide!

May not be legal in some states :)

Justin, I was all ready to run the importer with the new changes and my blogger account was moved to the new beta blogger site! Now, the login doesn’t work for the blogger import feature. Any ideas on who to ping to get the blogger import script updated to include the new blogger?

Scott, it looks like you might be up a creek…

Here’s the WordPress ticket tracking that issue: Blogger Import failing with Blogger Beta (#3063)

[...] Siguiendo las indicaciones que amablemente nos ofrecen desde Justinsomnia.org (aquí y aquí) procedemos a modificar el fichero blogger.php que se encuentra en el directorio wp-admin/import/ de tu instalación de WordPress. [...]

Thanks Justin, luckily I have an early import of the site to WP that I did before the Beta Blogger fiasco. The problem is that I imported them before using this script and so many of the links are incorrect (as you’ve described, without the “the” and so on). Is there a good way to retroactively apply your script to the WP posts to correct the naming convention?

I have as an RSS feed of the posts which I can import into WP. I could do a search and replace within a text editor to change the “post_name” tag to fit the blogger naming convention (the post_name currently is in WP style). The blog is 1600 posts long so I can’t really change each title by hand.

Any suggestions are greatly appreciated!

scott, you might want to send me an email to see what we can do. There are a number of strategies I can see taking. I haven’t played with blogger beta yet, but I’m assuming you can set the archive template so that you can output the permalink url and the title for every post by month in a format that can be readily imported into php (as an array). Then we could write a little code to lookup the post in WordPress by title and update its post-slug (the permalink identifier) to what Blogger used.

I have to enter /sitename/index.php/year/month/postname in the address in order to reach the individual post page. Any ideas what I did wrong?

[...] Oh, btw, the Blogger import thingy in Wordpress works pretty good – together with these hints/and modifications here and some additional .htaccess tweaks and copying of static files, the transition was pretty fast and smooth. [...]

If the importer fails with “Error on form submission. Retry or reset the importer.” then read this: http://wordpress.org/support/topic/82001

The redirect in my .htaccess file seems to have no effect, links are not being re-directed. Suggestions on where to start troubleshooting?

Ok, i’m havin some problems importing my beta blogspot blog into a wordpress one. I used This Script in PHP to export the blog, but as you can see my blog is in Spanish, so i use a lot the ñ and the accents and some of my post have very long tittles, so i’m having the problems you mention in the entry. I think i’ll wait for an official importer from wordpress or someone to release a solution

mjeppson, did you add the .html fixing rewrite rule as its own block, separate from the WordPress rewrite rules—this is important. You might want to try specifying the full URL in the rewrite, e.g.

http://www.freshdv.com/$1/$2/$3/

sinisterff, you’re better off asking the creator of that specialized script to add the ability to maintain blogger’s permalink slugs.

[...] Note: Si vous hébergez vous-même votre blog Blogger, visitez Maintain permalinks moving from Blogger to WordPress by Justin Watt (EN). [...]

I need some help with my WP permalinks. I don’t know the first thing about .htaccess and the code behind all of this permalink-stuff. So any help would be apprecaited.

I’m currently using the default WP permalink structure.
I’d like to change the structure to: /%category%/%postname%/

When I change the structure in the permalinks admin panel and I test the pages, I get what appears to be the main page of my site. (for example, the comment now box doesn’t appear, and there are other posts on the page).

Any ideas what might be causing this?

ben, hmm. You should not have to mess with the .htaccess file or anything in order to change your permalink structure. Have you tried changing it in a different way to see if that works, e.g. “Date and name based”?

/%year%/%monthnum%/%day%/%postname%/

Reading the Using Permalinks documentation, I see that:

%category% does not work correctly with some implementations of mod_rewrite in Apache versions prior to 2. If you are using Apache 1 and experience problems using %category%, either do not use %category% in your permalink structure, or refer to Schlueterica’s plugin.

Thanks for responding. I changed the permalink structure to the one you suggested:

/%year%/%monthnum%/%day%/%postname%/

but the problem remains. Take a look at GarnishBar.com and click on a post to see the result.

ben how strange. I see that WordPress is rewriting all the permalinks to the new structure, and it appears that mod_rewrite on your webserver is correctly forwarding the generated permalinks on to WordPress to determine what to serve (otherwise you’d be seeing 404 errors), but for some reason, WordPress is just returning the homepage.

In your root web directory (the one you move the index.php file into) does your .htaccess file look like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

In the very least, it looks like you’re not alone: 2.0.6 Problem with Permalinks. Perhaps try upgrading to 2.0.7?

Yup looks just like that:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Sorry ben, I’m not sure what’s going on. Could be some weird interaction between mod_rewrite and WordPress. I’d add your 2 cents to the 2.0.6 Problem with Permalinks support thread.

[...] PageRank de Google. Esto lo logré revisando algunos blogs que tuvieron el mismo problema: Maintain permalinks moving from Blogger to Wordpress y Moving from Blogger to Wordpress: Best [...]

Thanks. I was stuck with an .htaccess issue moving Whizgiggle permalinks, already-indexed as YYYY/MM/DD/post-title, to simply /post-title. Turns out I was mixing my rules with WP rules. Worked as soon as I moved my block up above the WP block. It’s important to think about what I’m doing I suppose. :)

I think I’ll poke around your site a bit. Looks nice. This layout is pretty snazzy. -bill

What about Wordpress 2.2? It seems that the blogger.php file is totally new. Any help ?

Hi I’m trying to import from blogger using the inbuilt blogger import tool in 2.2. (I was mightily impressed that you helped adapt it to ensure permalinks were being kept). However the permalinks are not being accurately imported. blogger.php is now markedly different to the one you refer to on this page, and I can’t make the changes you suggest.

As an example,

http://dermod.blogspot.com/2007/07/importing-podcast-into-wordpress-from_01.html

changes to

example.com/2007/07/importing-a-podcast-into-wordpress-from-blogger-part-two.html

In many cases, unless the permalinks are short, the wordpress created permalinks are longer.

Any idea what to do? I’ve posted this question on the support forums here.

Thanks for your time

Dermod

I have made a patch to the blogger import code from Wordpress 2.2.1 that will maintain the blogger styled URI on your new WP site. Have a look at http://my.opera.com/djp/blog/2007/07/02/maintain-permalinks-moving-from-new-blogger-to-wordpress-2-0 and let me know how you get on.

Superb, David, well done, works a treat!

Just a quick question to follow up – I need to write in the .htaccess file a rewrite rule that changes requests for the old blogger archive and labels files to either the relevant archive and category pages in wordpress, or at least the index page. Google tends to use archive pages in old results.

So if someone is looking for the May 2006 archive, the structure in blogger is:

http://bonhom.ie/archive/2006_05_01_archive.html

In wordpress, the structure will be:

http://bonhom.ie/2006/05

Similarly, with categories/labels, the blogger structure is, for example with music:

http://bonhom.ie/labels/music.html

The wordpress structure will be:

http://bonhom.ie/category/music

I attempted tinkering with the .htaccess file myself but I don’t know what I’m doing and it crashed wordpress.

Any help would be greatly appreciated!

Sorted it out myself. Answer is:

RewriteRule ^labels/([^/]+).html$ category/$1/ [QSA,R,L]
RewriteRule ^archive/([0-9]{4})_([0-9]{1,2})_([0-9]{1,2})_archive.html$ $1/$2/ [QSA,R,L]

hi justin!

i am with js-kit and we have some cool widgets for blogs. i am writing to see if you would be interested in working with us to create plug-ins for wordpress for our widgets.

you can reach me at khris at js-kit.com

http://www.js-kit.com

I just wanted to say thanks for Instruction #6 on how to change your permalinks to have the html at the end and Wordpress Suicide. I tried it tonight, was able to delete my blog and reimport. Thanks so much!

I’ve significantly updated this post for WordPress 2.3 (from WordPress 2.0.4) including a new single button push utility plugin that will update all your imported Blogger posts to use their old Blogger post slugs.

Once you run the plugin you can deactivate it and delete it. It does not need to stay installed to work.

Superb plugin Justin, I’ve just applied this to our blog and the URL’s are now exactly how I wanted them (the same as blogger).

I’m actually having a problem with the RSS feed using FeedBurner at the moment though, getting a 404 error when trying to burn the feed, they seem to think this is caused by the new permalinks. Would be great if you have any ideas about how to fix this.

Thanks,
Kevin

Kevin, yeah, if you had Feedburner set up before updating your permalinks to the old Blogger slugs, FB may publish old permalinks for a while. However looking at your feed, all the entires now appear to resolve correctly.

Howdy, a couple things to make your article more visitor friendly…. well, more friendly to non-techie types. Its fair to assume many come here already wanting this specific information but some of us come just to even begin understanding how to make the switchover from Blogger to WP, so explaining the major benefit(s) of employing this action would be super valuable.

In other words, I see that it is possible but what is the downside if I don’t keep the slugs the same? What is the upside if I do?

My main concern is to create a fluid movement from people coming in from an old link and being able to get to the right area on the new site.

Is that possible?

Thanks,
Sam
ps. maybe put (updated for wp2.3) at the very, very top. Again, thanks.

is there an update for this for the new WP 2.3.2?

I believe this should work with 2.3.2… Please let me know if that’s not the case.

Justin, the plugin works fine whit wp 2.3.2 version, my blog export ok from blogger, thank you! I made a little donation to your plugin

Thanks Thanks Thanks, It’s so help full i would be lost with out this post actually i’m moving my blog from blooger to wordpress, by the way i dont want to loose my permalink and search results . i have been trying lots of method for past 2 weeeks, yours worked

I am so obliged to you , thanks thanks so much

Hi, this is my wordpress structure :
/index.php/%year%/%monthnum%/%day%/%postname%/
When i try the instructions, i obtain an Error 500 on the server, and i must delete the .htaccess file !
When i try to change my wordpress structure, Error 500 too ! Can you help me please?

Hi Robert, it sounds like your webhost may not be set up to allow .htaccess files? I would try to contact their support staff who probably have experience with configuring WP.

But looking at antivoitures.free.fr (if that’s the blog in question) suggests that the permalinks are ok.

Thanks for creating this script! This saved me tons of time I’m sure. :)

Hi! i only want to say thank you for your usefull plugin!
Really i searched over internet for long time to solve blogger to wp redirection problem, without success…..now sems work all fine!
thank you again
G. (WP 2.3.3)

THANK YOU THANK YOU! This plugin saved my sanity! It worked!

One little question– can I delete the old Blogger blog? Will this affect the redirects?

just to clarify, this is only keeping the post title/slug and not the actual URL set up?

Well, Cole, it depends. In the early days of Blogger, before Blogspot, people used it to publish to their own webspace. So if you still own the domain at that webspace, and you want to move from an ftp-hosted Blogger blog to a WordPress-powered blog, then yes, this would help you to maintain the very same permalinks.

If however you’ve been using Blogger with a blogspot.com subdomain, then this will only keep the post slug the same, which doesn’t really buy you much.

Thanks, Justin. I was just confused because in the example you use year/month/name but my Blogger (via FTP) has a set up of year_month_date_archive.html#postslug I am looking for a way to avoid broken links and easily redirect visitors to the new location – would this do the trick then?

Cole, technically, this:
year_month_date_archive.html#postslug
is not a “true” permalink, it day archive with a link target. I’m sure there’s a way to maintain those style “links” but it’d probably take a lot of effort and some javascript hacking, etc etc.

hi
really thanks for your plugin :D

is there anu solution for chinese blog? because when i use /%year%/%monthnum%/%postname%/ this custom setting,
my postname(which is title),will become a lengthy numerics

Xiawa, do you have an example of a Blogger permalink before and a “numeric” WordPress permalink after?

I know WP coverts Unicode characters it doesn’t understand to URL entities like Wikipedia does, but I’m not sure how Blogger treats non-ascii/latin Unicode characters in permalinks.

Thanks very much for the plugin! It’s exactly what I was looking for.

Do I follow these steps before or after importing my blogger blog?

Also (sorry for the double post), this also works for blogspot hosted blogs which have their own domain?

Dan, I didn’t realize blogspot blogs could have their own domain, but if so, then yes, this should work. And you should run this after you import into WordPress. If you run into problems, feel free to leave a comment.

thanks a lot for this great tip! i have finally moved my blogger account into wordpress platform including SEO points hopefully, it worked perfectly from my vertito.blogspot.com blogger account

nice ! keep it up!

Does it still work with Wordpress 2.6 ?

After reading dozens of websites which didn’t give me what I needed, I found your “suicide” script and your permlink instructions. I need to add that I had to export my posts table and perform “edit…replace” to remove all traces of myblog.blogspot.com over to the new domain root. Now, all my links and references to posts are working properly. Great job. Thank you so much. I owe you big time!

Hi,
I was psyched when I found this plugin but then I realized that it may not be applicable to me. I have been publishing on blogger and not my own domain (hence my URL contains blogspot)… My plan is to transfer to wordpress and publish to my own domain. But I think your tool wouldn’t help me since it seems to apply only to the part of the permalink following the domain name… right?

Is the only way to keep my links available to readers by leaving my blogspot blog up?

I think I’m making sense. Please let me know.

Thanks,
Stacy

Can I use this tool if i want to use wordpress permalinks like http://www.example.com/%postname%/

Can i use this, will this protect blogger links ??

I too am publishing on Blog*Spot, and am wondering how to perform the move. My circumstances are pretty much identical to Stacy’s above.

Hi there, seems I found a place where maybe I cant get a bit orientated. I am having a problem, I have Wordpress 2.7 and the only way my blog permalink structure works is with the index.php part (which I didnt have on Blogger). Ex. /index.php/%year%/%monthnum%/%postname%.html

How do I avoid using index.php? I am unable to access .htaccess file because my hosting provider doesnt supports it.

Any ideas?

Thanks for your help!

Fernando, it might be a requirement of your webhost to leave the index.php in the permalinks. I would check with them. There’s lots of helpful information on Using Permalinks.

Does this still apply for migrating to Wordpress 2.7?

Justin, when I tried to install the plugin, I got the following message:

“Incompatible archive: PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature.”

Any advice?

Thanks.

Dave, I dunno, haven’t tried. Let me know if it works for you.

Mary, sounds like something is wrong with WordPress’s ability to unzip a zip file. I don’t know why that would be a problem here.

I can’t get this the plugin to work for wordpress 2.7

This worked fine on WP 2.7 for me. Note that the Maintain Blogger Permalinks link is under Tools in 2.7. Thanks!

Hi Justin: maybe you can help, I imported 248 posts into the wordpress self hosted site i have from the former blogger site (http://PoliticolNews.blogspot.com site and everything went okay. I closed down the old blogger site, now the links to the old posts are going nowhere. New site is: politicolnews.com

How can I change the links on the current site, which I have set to % postname% – so that all those old blogger posts -point to my new site’s posts where they are located now?

Don’t want to have to rewrite all 248 articles for the links I have lost. Any ideas? hosted with hostgator, I am not techie so have to get someone to do changes in cpanel. thanks. Teri

teri, i don’t believe there’s anyway to have blogspot.com redirect to your new location on wordpress.

hey there! So I’m using this, but am super sad it’s not working for 2.7. I just realized a ton of my incoming links aren’t getting converted.

Can I nudge you to try to update it to work for us? Pretty pleeease? :) :)

here’s an example of what’s NOT working, if this helps:

original link: http://willotoons.com/blog/2004/11/whole-new-look-on-life-my-lasik-story.php

new location: http://willotoons.com/blog/2004/11/a-whole-new-look-on-life-my-lasik-story/

seems blogger not using “a” in their permalink title is what’s throwing it off?

halp!

willo, i’m not sure if anything has changed as far as the wordpress blogger importer in 2.7, but in previous versions, they saved the original blogger permalink in a custom field called “blogger_permalink”. check one of your imported posts and see if you have this in the custom fields. if you do, then the plugin, should work. if not, you might be out of luck…

Hi! Awesome plugin:) I’m getting this problem with SOME (most of the post came out great) posts: mistmatching month!

Example:
/2009/02/ciudadania-espanola.html WP
/2009/01/ciudadania-espanola.html BLOGGER

What do you think it coul be the solution? I’m guessin ti has somehting to do with those post that are saved as drafts and then published.

Juan, that’s truly odd. I’m not sure how WP could have gotten the date so wrong—perhaps it has something to do with timezones and misinterpreting GMT?

it works for 2.8.2? :)

I’ve read everything twice but I’m still confused about exactly what this plugin will achieve for my new WordPress blog. I just moved over from Blogger and I would like all the links that currently click through to posts back at my old Blogger site to become navigational within the new WordPress site (so I can close down the old site). Is this possible? And is that what your plugin is for? Thank you!

Milli, shoot me an email and I’d be happy to explain.

Moving my blog. was really looking forward to using your plugin. It was the first one I installed!! It is a brand new wp site. must be a recent version. And it’s not working. If my wp is too new, can you teach us how to tweak it. Please.

Kelly, I just added a section to this post above the instructions that tell you what to do if your current Blogger blog is hosted using blogspot.com (i.e. if it has has blogspot.com in the URL). Let me know if this helps. Otherwise, shoot me an email.

Justin, thanks for the reply, but we cant make that code work to maintain permalinks. We have tried various options of changing it too and nothing works. Also sorry to comment again, but “shoot me an email” takes me to an about page w/no email link.

It seems like you know this stuff well; do you have any other ideas? I have looked high and low…
btw, we never found a button anywhere in wp which says “maintain permalinks” when we activated the plugin. We just clicked “activate.”
Thanks.

Kelly, my email address is listed on my about page under “contact”…

this is an excellent solution and thanks for the redirect code.

Thanks for all the help Justin!
It’s working great!!
You have the method that works! We’ll tweet your blog today too.

Hi thanks for this wonderful article. But i want to share something here. You have told that after september 2009 there is no way for 301 perma redirect. I hope this statement is wrong. I moved to wordpress in the middle of september with complete 301 perma redirection and its working perfectly well. You may contact me if you want to know more about it.

You! Have! Saved! My! Life!!!

Thank you so much for this plugin and excellent instructions. It works perfectly for me. I had a Classic Blogger blog that I hosted myself and published via FTP. I had over 500 posts and could not figure out how to redirect the old URLs (to which there are many, many links on other web sites) to the new URLs. I thought I was going to have to create individual 301 Redirects for every single page, which I could do because I wasn’t hosted on BlogSpot. Thank god I found this article before I tried that. AND thank god I only wrote 3 new posts in WordPress so far and had to change some of the internal links in those posts to the new “old” Blogger format created after installing your Plugin.

Your instructions were very clear and easy to follow. Since you are so good at this stuff, are there any other Plugins you recommend as essential for WordPress newbies?

Beth, that’s wonderful. I’m glad you found this useful. it sounds like you are one of the rare people to have been in my spot when I switched from Blogger to WP. Most people nowadays just use blogspot.com, which makes true redirects well-nigh impossible.

As far as other plugins to recommend, most of the ones I’ve written are utilities like this one. One you might enjoy since you include a lot of pictures in your posts is the Random Image Plugin for WordPress. It display a random picture on every page load that links back to the post it came from. Configurable, but super simple out of the box. Visual serendipity I call it.

Hey Justin I’m trying to move my blog from blogspot.com over to wordpress and I have a silly question for you… how do I edit the .htaccess file?

I’d like to pop in the code you provided to change the .html files but I’m stuck! I have no idea how to do this.

Thanks for your help!

Ginger, basically the “.htaccess” file is created by WordPress (if it has access to do so) in order to tell Apache (the webserver) make your permalinks “pretty”, e.g.
http://example.com/2009/10/my-blog-post/
instead of
http://example.com/?p=123

You may be able to edit it under Appearance > Editor in WordPress directly, otherwise you may have to use FTP or your webhost’s control panel. Here’s some more documentation: Creating and editing (.htaccess).

Hi !

Thank you very much for all the information. I think I did everything right but I am not sure it is working because my old blog http://www.blog.nameofmyblog.org is not redirecting on my new one… Do you know why ? Do I have to do the stuff with Javascript?
There is nothing to do on Blogger?

Hi Justin,
Thanks for the great post. I am self-hosted but using blogger and I need an upgrade. I have downloaded wordpress and plan to make the change this week.
One question… if I set up wordpress in a directory that is blog/fabricwrappermusings.html so that it is in the same place it is now, for the period that I upload wordpress and move and fix my blogger postings will anyone on my site see all of this confusion live? I assume there is no way to avoid it other than to rename the blog…
Thanks for your advice!!!

Steph, my recommendation would be to set up WordPress in another directory like “wordpress” at first in order to do all your testing and importing. Things may go wrong, you may need to start over, etc, so it’s just easier if your testing happens in a separate directory from your current live blog. Then when everything is working in http://www.fabricwrapper.com/wordpress/ Do the following, in this order:

1) Update the WordPress’ expected URL in the WordPress Admin under Settings > General from http://www.fabricwrapper.com/wordpress to http://www.fabricwrapper.com/blog (at this point WordPress will be temporarily broken)
2) Move your old Blogger “blog” directory to another directory, like “old-blog”
3) Move your new WordPress blog from “wordpress” to “blog”

Then eventually I’d recommend creating a redirect so that old requests to “http://www.fabricwrapper.com/blog/fabricwrappermusings.html” get redirected to “http://www.fabricwrapper.com/blog/”

Voila, you should be all set. Let me know how it goes.

OK, the first part worked great… I moved the blogger blog from self-hosted to blogspot, opened a wordpress.com account, moved the blog there, then downloaded wordpress.org and moved the blog there. So here it is (obviously needs work!): http://www.fabricwrapper.com/Blog/wordpress/
Thank you for getting me this far!
My next issue is that I want the URL to be http://www.fabricwrapper.com/Blog/fabricwrappermusings (not wordpress!) I screwed up when I named the file folder I put this in, not realizing that would end up being my new address. Is there any way to change this without doing it all again? Can I request a redirect with my host?
Thanks again, Justin!!!!!

Steph, if I might make two recommendations: don’t include capital letters in URLs (e.g /Blog/) and simplify your URL structure so that the homepage of your blog is just:

http://www.fabricwrapper.com/musings/

That makes for a much cleaner, readable URL, not to mention shorter, which is better for including in emails and having to type out by hand.

As far as how to do that, it basically requires doing what I recommended in my previous comment. Update WordPress’ expected URL in settings to the URL above, and then move WordPress into a directory called “musings”. If you need more help, feel free to send me an email.

Hi Justin: Everything so far working fine. In fact, when I activated the plugin, my theme finally displayed. (I think it was because there was no .htaccess file in the WP folder yet). But when I put the code in the .htaccess file – making the RewriteBase line match the one in the # BEGIN WordPress block, I get a browser Redirect Loop. (I get a server error if I leave it like yours … my blog IS in a folder called “blog.”)
Any ideas? Thanks a bunch!

Gr8 post …. It worked for me .. thanx a lot justin.
i wnt to make sure one thing.is this a safe way (i mean,regarding maintaining pagerank and google juice)?

Patty, that seems strange, it sounds like something else might be going on. Perhaps you have multiple .htaccess files interacting. What was your “RewriteBase”?

Logesh, there’s nothing about this post that is specific to page rank. It simply is a way to provide continuity between Blogger and WordPress. It just so happens that that helps Google maintain pagerank, but that’s really just a side-effect.

Just wanted to say that this plugin/method has worked perfectly for me several times. Thanks for such an easy fix!

Shannon, so glad you found this useful—it amazes me that it continues to work after more than three years. Thanks again for the kind donation.

everytime i click your #2. my computer downloads it as a php file for adobe go live. it doesnt download as a zip…

what should i do?

Lola, try using a different browser. The .zip file downloads fine for me in Firefox.

ok i got it to upload… but i have a question. let me give you the background first:

i am going from blogger to wordpress selfhosted
1. i first bought the domain name and converted my “somename.blogspot.com” to “somename.com”– that made all my posts have somename.com/nameofpostings.html instead f the somename.blogspot.come/name of posting.

2. i am using a temporary website provided by bluehost/wordpress.

2. within wordpress i converted my permalink structure to a custom structure using this code: /%year%/%monthnum%/%postname%.html

alot of websites ive read said using this method will minimize the breaks in links once i make the “big change over”.

3. i then imported all the links.

now this is where i need your help or advice.

i want to know if i can download your plugin, so that i can ensure my links are converting correctly, while also keeping the, /%year%/%monthnum%/%postname%.html custom permalink structure.

if i download your plugin will everything still work properly?

i was going to also download and use this redirection tool: http://urbangiraffe.com/plugins/redirection/. which is recommended by many people

basically, i want to cover all bases.

what do you think?

thanks so much in advance!

ooo, there’s alot of typos in their including my numbering… sorry about that justin. let me know if something isn’t clear…

and i meant: “all my posts have somename.com/nameofpostings.html instead of the somename.blogspot.come/nameofposting.html”

Lola, as you can see from the other 105 comments on this post, this technique has worked quite well for a number of people. But yes, you can use it with a custom permalink structure of /%year%/%monthnum%/%postname%.html which means you can ignore the bits of my instructions about setting up custom .htaccess rules (skip step 8).

Keep in mind that my plugin is one time use only. You just run it once, and it will update your imported Blogger posts in WordPress to have the same permalink base as they had in Blogger. If it works, you can uninstall the plugin and go about your business.

Just, Thank you for this information; I had originally setup a client to work with a system that creates new posts with .html matching the Blogger structure and quickly found the error of that way; WP-Print won’t work with pages ending in .html and many of my clients are food bloggers so a print function is a must.

But I do have a question. I’ve just transferred a client from blogger to WP. Most worked fine as she had changed to using a ‘custom’ domain a while back. It appears now though that she still has some Google links with her old blogspot address and for the life of me I can not get those to redirect. The problem I’m having with your script is in Blogger; it wants to change the the code syntax; changing the apostrophes around the domain names in the code to html text; which results in an error message and will Blogger will not save.

Any thoughts?

Thanks!

Barbara, if your client still has old blogspot URLs out on the web (in addition to in Google) the only way to ensure that they redirect is using Javascript in the Blogger blog. In fact I would even go so far as to remove the content on the blogspot pages and replace it with a “This page has moved to http://…” link, in addition to the Javascript redirect. Eventually Google will realize the content has moved and will update their index. It’s not as nice a solution as a simple 301 redirect (if she had been self-hosting Blogger), but it’s better than nothing. If you have any other questions, feel free to send me an email.

i didnt read the other 105 comments, but the ones i were able to scan didnt seem to have the exact question and answer.

so are you saying that after i upload it once into my wordpress blog, then i dont ever need to upload again? even if i import more postings?

Lola, usually most people only transfer their posts from Blogger to WordPress one time, so your question, “even if i import more postings?” doesn’t make sense to me.

What this plugin does is change the permalinks of your WordPress posts to match the permalinks created by Blogger. Once you activate it and run it, you can deactivate it and delete it. Along with the custom permalink structure you already mentioned, your WordPress permalinks should match your old Blogger permalinks exactly. I hope that makes more sense.

Hey Justin,

Thanks for the time you take to help with migration.

I have a bunch of FTP Blogger Domains. So I converted a minor one to BlogSpot, and then imported to my WordPress Custom Domain. All of the URLs now match my original blog, so I am happy. However, this minor blog didn’t have any pics, so I don’t know if the pics would have transferred or not using your method.

I had originally used a temporary WordPress.com dummy blog to import from Blogspot to export an XML file because that step is listed in quite a few other tutorials. Then I was supposed to run your plugin, but it only looks for a Blogger Import, not a WordPress import.

Other sites instructions also say to use Custom Structure’ and enter the following in the box ‘/%year%/%monthnum%/%postname%.html’

Is this stuff for older versions of WordPress?

Using your method, do my blog post pictures also make the conversion?

Thank you sir, I tried reading all 112 comments, so I apologize in advance if this has been handled before.

I want to make sure that I can follow your simple steps and not use a temp WordPress.com import/export staging area.

Hey Damian,

This plugin simply ensures that the permalink part of the URL in WordPress matches what it was in Blogger (not including that .html part—that you have to handle with appropriate redirects). It’s one-time-use-only. After you run it, the permalinks are updated, and you can deactivate it and delete it.

It doesn’t have any impact on the import from Blogger itself, nor on the images embedded in your posts—that’s all up to the import script included with WordPress. So I’m not sure if the Blogger images are copied over to WordPress. I hate to say it, but I’m guessing not. Would be relatively easy to test though.

I’m not sure why other tutorials have suggested importing into a temporary WordPress.com dummy blog. You’re correct though, as far as I know, my plugin above only works if you’ve imported directly from Blogger.

As for the custom permalink structure, I prefer /%year%/%monthnum%/%postname%/, and then I have a redirect that updates any .html URLs to that. Some people can’t or don’t want to do a redirect, so they just use /%year%/%monthnum%/%postname%.html as their permalink structure. Either works.

Hope this helps.

Yes, it helps. The pix made it as long as I uploaded “uploaded_images” from my blogger dir. I had made a copy. Thanks, you plugin is great.

Damian, glad to hear it. Best of luck.

This was very helpful. Thank you.

ok. I can’t figure it out. when someone clicks on- http://whosies.blogspot.com/2008/04/ending-bum-crack-one-pant-at-time.html
It redirects them to the main page, permalinks don’t change. any help?
plus, where is the htaaccess file?

Becky, I turned off JavaScript so I could look at what you’d put in your blogspot blog and I saw this:

window.location.replace("http://www.patchworkposse.com/blog/");

Which is why you are only getting redirected to the homepage. In order to redirect to the correct permalink page, you need to use the javascript snippet at the bottom of my post in order to correctly redirect to the new permlink for each post.

And you should find your “.htaccess” file in the root directory of your WordPress install which for you should be: blog/

Hi,

Firstly congratulations on a great guide. However I’m still confused by a few things. I’m planning to migrate from a Blogger custom domain to Wordpress. Does the section ‘How to setup a Javascript Redirect’ apply? Because at the beginning you say you have to do this part ‘if you have a blogspot.com site.’

Yet surely once you migrate to Wordpress, you transfer the custom domain and therefore your original blog becomes a blogspot blog anyway?

Also, when you move from Blogger to Wordpress what happens to the ‘Labels’? Do this guide automatically transfer them into Wordpress ‘Tags’ or ‘Categories’?

Thanks.

J, I haven’t had much experience with Blogger’s Custom Domains, but since you technically own the domain, and since I’m assuming that’s the domain you’re going to use for your self-hosted WordPress blog, then Blogger’s Custom Domain service and Blogger’s soon-to-be-extinct FTP publishing service are functionally the same. Which means you won’t need to worry about setting up a Javascript Redirect. Please let me know how it goes (feel free to send me email if you have any questions) so I can update this post with that info.

Thanks very much Justin. I’m still looking for a good WP template so haven’t begun migrating yet. But with a custom domain is this the best guide to follow therefore?

If so I’ll let you know how it goes.

Hi Justin,

Just about to use this plugin now but I’ve just read through all the comments and it brought up 2 questions in my mind:

1) If you’ve installed WP to a subdirectory, can you still run this plugin? I intend ultimately to re-direct WP so my original domain is the chief website (rather than mysite.com/blog), but read it was better to install WP in a subdirectory to start with. Will that affect this plugin though?

2) You also say this to one of the commenters: ‘my plugin above only works if you’ve imported directly from Blogger.’

I originally imported from Blogger, but because it only kept about 1/10th of all comments I deleted everything, exported all Blogger contents to an xml file & transferred it to a wxr Wordpress file and imported them that way. Will this plugin still work for people who imported like that?

At the moment, in the WP dashboard, the permalinks I have checked render in the same way as Blogger, except WP includes all the words while Blogger cuts them off at a certain point.

J,

1) Yes, this plugin works if WP is installed in a subdirectory—in fact that’s the preferred method to install WordPress, regardless of whether you want your blog’s homepage to be http://example.com/ or http://example.com/blog/ (see: Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory)

2) Correct, the post metadata that this plugin relies on to restore the generated WordPress permalinks to their original Blogger versions depends on the posts being imported using Blogger importer that comes with WordPress. Exporting from Blogger, then transforming that into WXR, then importing that will not allow this plugin to work. I’ve added a note to the instructions to make that clearer.

If you’re having trouble using the built-in Blogger importer, did you try re-running it? Sometimes your webhost may be capping PHP’s memory or execution time, which would cause the import to stall. But it’s supposed to not double import the same content if you run it multiple times.

Hmm that is a major stumbling block then :-(

On the import WP sees all the posts but only about 1/10th of the comments. Obviously thats a big problem for me, and the only way round it I found was to convert to a wxr, which had the added advantage of importing tags as tags and not categories.

Is there a way to perform this maintain permalink process for those who imported a wxr file? If not how can I work round the problem?

Forgot to say, I increased the memory size on the php files yet Blogger still only recognises 40 of about 700 comments.

monthchunks

license

Justinsomnia is licensed under a Creative Commons Attribution 3.0 License.

Please see my Attribution Policy for more information.