October 2018
no image
You will need to add this code to your WordPress theme’s functions.php file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
add_action( 'init', 'wpb_update_slug' );
 
function wpb_update_slug() {
global $wpdb;
$result = $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_permalink' ");
$wpdb->print_error();
foreach ($result as $row){
$slug = explode("/",$row->meta_value);
$slug = explode(".",$slug[3]);
$wpdb->query("UPDATE $wpdb->posts SET post_name ='$slug[0]' WHERE ID = '$row->post_id' ");
}
echo "DONE";
 
}
After saving the code, you just need to visit any page on your WordPress site to trigger this script.
Note: After the script has run, don’t forget to delete it from your functions.php file because it only needs to run once.
Bonus Free Offer: Don’t want to deal with code? We have got you covered. Since a lot of you asked for this, we are now offering free Blogger to WordPress migration service as part of our free WordPress blog setup service. This means one of our expert team member will do the entire migration for you (100% free). Yes, you can literally switch from Blogger to WordPress without any risk.