Opened 16 years ago
Closed 14 years ago
#4622 closed defect (bug) (fixed)
Importing Blogger Post Slugs
Reported by: |
|
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)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Blogger.php File with Patched code