Make WordPress Core

Opened 9 years ago

Closed 7 years ago

Last modified 6 years ago

#3241 closed enhancement (wontfix)

Blogger importer doesn't maintain existing permalinks (post slug/name)

Reported by: justinsomnia Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.0.4
Component: Import Keywords:
Focuses: Cc:


The current Blogger importer script doesn't grab the existing permalink URL, so post_names (aka slugs) are generated by WordPress based on the title, which can sometimes differ significantly from those created by Blogger. For instance Blogger limits post names to less than 40 chars (without breaking words), it strips non-ASCII characters, and it removes article words (a, an, the).

I've written up more information about the problem along with the fix here:
Maintain permalinks moving from Blogger to WordPress

People moving from a self-hosted Blogger blog to WordPress are usually keenly aware of wanting to maintain the links to their posts (usually for PageRank purposes). Unfortunately the current script makes this impossible without manually comparing and updating the post name for every post!

Luckily it turns out that importing the Blogger post name is insanely easy (unless there's some scenario I'm not thinking about). In any event, I'm attaching a patch that I've tested successfully on a Blogger blog with 400+ posts.

Attachments (1)

blogger.php.diff (2.8 KB) - added by justinsomnia 9 years ago.
grabs Blogger permalinks and extracts post names

Download all attachments as: .zip

Change History (11)

@justinsomnia9 years ago

grabs Blogger permalinks and extracts post names

comment:1 @Nazgul8 years ago

  • Keywords has-patch added
  • Milestone set to 2.3 (trunk)

comment:2 @westi8 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.3 to 2.4 (next)
  • Owner changed from anonymous to andy

Current patch doesn't apply.

Blogger importer is very different now.

From a quick look at the code it still doesn't pass down the blogger permalinks but it does store them in post meta:

add_post_meta( $post_id, 'blogger_permalink', $entry->old_permalink, true );

Switching to needs-patch and sending off to the future.

Assiging to andy as I believe this importer is his baby.

comment:3 @Otto428 years ago

Suggestion: Get the blogger slug from their permalinks, and put it in the "_wp_old_slug" meta variable. Then you can keep your new slugs (which are not nearly as hideously ugly as Blogger's slugs are) and still have the old slugs work too (with the old slug redirection code).

comment:4 @ffemtcj8 years ago

  • Milestone changed from 2.5 to 2.6

comment:5 @thee177 years ago

  • Component changed from Administration to Import

comment:6 @FFEMTcJ7 years ago

  • Keywords reporter-feedback added
  • Resolution set to wontfix
  • Status changed from new to closed

Is this still valid? This is two years old with no real activity in more than a year. Closing. Re-open with more info.

comment:7 @mrmist7 years ago

  • Keywords needs-patch reporter-feedback removed
  • Milestone 2.9 deleted

comment:8 @mrmist7 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

comment:9 @mrmist7 years ago

  • Owner andy deleted
  • Status changed from reopened to new

comment:10 @mrmist7 years ago

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.