If you formerly have Blogger as your blog, and you want to migrate to WordPress, you may want to import everything to your new WordPress blog. WordPress already have this feature.
- Go to wp-admin, choose Tools -> Import -> Blogger
- Follow the steps and your wordpress blog should be filled in no time
Now, the problem isn’t that simple. When you’ve done importing, you may notice that in EVERY post content, post title, and comment there is a >(greater than) character. I find this VERY annoying, so I decided to erase them.
Erasing it will be a very big deal if you already have many posts. Plus, if you erase it via wp-admin, your database will be filled with useless revision. I don’t want that to happen, so I think of an idea: Erase it directly at the database!
Supposing you’re using MySQL 5 or newer, execute this query:
UPDATE `wp_posts` SET `post_title` = SUBSTRING(`post_title`, 2) WHERE `post_title` REGEXP '^>'; UPDATE `wp_posts` SET `post_content` = SUBSTRING(`post_content`, 2) WHERE `post_content` REGEXP '^>'; UPDATE `wp_comments` SET `comment_content` = SUBSTRING(`comment_content`, 2) WHERE `comment_content` REGEXP '^>';
If you do it right, your posts, titles, and comments will now be clean from that rubbish already.
Hope this will be useful π
gag ngerti kegunaan REGEXP… apa kayak LIKE gitu?
Hampir sama, cuma beda sedikit di cara pakainya.
Untuk contoh kasus penggunaannya masih belum tahu π