A python script to generate SQL queries for importing links/blogroll in another wordpress blog

Here's the problem: There are 30 precious links in my old blog under blogroll. Exporting feature of wordpress does not export the contents in blogroll/links. The task is to import those links in this new blog with minimum effort.

Well, Adding 30 links manually ain't difficult - it may take a maximum of 15 minutes to complete the task. But it's too repetitive and boring. The best way is obviously writing a script.

Here's a small python script that generates SQL queries to insert old blogroll items in new database. It will ask for old blog URL and new database name - that's it, it will search your old blog for blogroll links and print INSERT statements in stdout suitable for executing in phpmyadmin or directly in mysql shell :)

Hope you like it, Thank you :)

Leave a Comment