Make WordPress Core

Opened 17 years ago

Closed 14 years ago

#4622 closed defect (bug) (fixed)

Importing Blogger Post Slugs

Reported by: clazh's profile clazh Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.3
Component: Import Keywords: Blogger, Import, Post Slugs
Focuses: Cc:

Description

Hi there,

Recently a friend wanted to move from blogger to wordpress but he was afraid to do it since after importing Wordpress auto generates the post slugs hence the permalinks change. I hunted around and found a solution. It involves adding just 2 lines of code in the blogger importer. I have blogged about it here

at around line 520. Insert these 2 lines after the call to wp_insert_post;

preg_match("/([^\/]+)\.html$/", $entry->old_permalink ,$matches);
$wpdb->query("UPDATE $wpdb->posts SET post_name = '" . $matches[1] . "' WHERE ID = '$post_id'");

Attachments (1)

blogger.php.patch (35.9 KB) - added by clazh 17 years ago.
Blogger.php File with Patched code

Download all attachments as: .zip

Change History (3)

@clazh
17 years ago

Blogger.php File with Patched code

#1 @thee17
16 years ago

  • Component changed from Administration to Import
  • Owner anonymous deleted

#2 @ryan
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Looks like the latest version has some old permalink handling.

Note: See TracTickets for help on using tickets.