Switch Blogger To WordPress Without Losing any Single Page View

Subscribe our YouTube Channel    

Permalink Structure


/%year%/%monthnum%/%postname%.html

functions.php Code


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 "All Done..";
} 
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

Bharat Makwana is a Founder & Owner of Veewom. He is Content creator and Web Developer from past three years. He loves to read and get in touch with the latest technology, he also have YouTube Channel BMTechTips ,for more info contact - hi@bharatmakwana.com.