Bookmark Exodus: Export the WordPress Blogroll and Import to del.icio.us

[ Image: del.icio.us Icon ] After our recent WordPress-2.1 blogroll debacle, we concluded that the WordPress Links Manager (aka the Blogroll) is no longer a viable, long-term solution for managing bookmark collections containing large numbers of links. A far better solution, in the eyes of many savvy web users, is the free social bookmarking service del.icio.us. Using del.icio.us for over a year now, we have found it to be highly flexible, always reliable, and infinitely extensible. Plus, as a social bookmark service, everyone benefits from everyone and quality resources are much easier to find. The dec.isio.n to switching from the Blogroll to del.icio.us is, in our opinion, a no-brainer.

Exporting Links from the WordPress Blogroll

With that in mind, we set out to export our entire 700+ collection of links from the WordPress database and import them to del.icio.us. As it turns out, the most difficult part of the migration is exporting the links from WordPress in a format that is recognized by del.icio.us. Unfortunately, del.icio.us is very picky about acceptable formatting. From the del.icio.us “import/upload” page:

You can also use step 2 to upload bookmarks exported from del.icio.us or a different service, as long as they’re saved in a standard bookmarks format. … Note: uploading XML, Excel files, mp3s, or anything except bookmarks files probably won’t work.

Ouch, no XML. del.icio.us makes it perfectly clear that their current batch-upload feature only works with bookmarks exported directly from a browser (e.g., Firefox, Internet Explorer, Safari, Opera, etc.). Just about anything else simply won’t work. Fortunately, it is relatively simple to adapt the Netscape Bookmark File format 1 to any exported set of WordPress Blogroll links.

For example, here is a set of common search-engine links formatted for easy import to any del.icio.us account:

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>My Bookmarks</TITLE>
<DL><P>
<DT><A HREF="http://www.google.com/" title="Google">Google</A></DT>
<DT><A HREF="http://www.yahoo.com/" title="Yahoo!">Yahoo!</A></DT>
<DT><A HREF="http://www.msn.com/" title="MSN">MSN</A></DT>
<DT><A HREF="http://www.ask.com/" title="Ask">Ask</A></DT>
</DL><P>

In our example, we have exported the links from our Blogroll category “Search Engines” and applied the requisite formatting for del.icio.us import. These links may now be tagged on the del.icio.us Import page as “Search Engines” and imported accordingly. Ideally, one would export each Blogroll category from WordPress, tag it with its category name, and upload it to del.icio.us. Wash, rinse, repeat. Likewise, given a file size of less than 5MB, it would be possible to simply export the entire Blogroll, tag it as “Imported” (or whatever), and batch upload the entire collection in one fell swoop.

The trick, then, is formatting the exported Blogroll links with that archaic-looking Netscape markup. Simply query the links table in the WordPress database, apply the requisite markup, and display the formatted results. If this all sounds like way too much work for something that should be a piece of cake, don’t worry — it wasn’t that bad. The good news is that I am sharing the fruits of my labor by releasing the official Export Blogroll for del.icio.us plugin.

The Export Blogroll plugin makes exporting the Blogroll super-easy and provides several export options: “export by category”, “export only private links”, “export only public links”, and “export all links”. Simply make a selection, upload and activate the file, and grab a copy of the exported Blogroll via the WordPress Admin. Save it to a file, login to your del.icio.us account, and prepare for import..

Importing Blogroll Links to del.icio.us

With the help of the Export Blogroll plugin, you should now have at least one file (.txt works fine) prepared for del.icio.us import. To import your file, login to your del.icio.us account and go to the import/upload page (https://secure.del.icio.us/settings/USERNAME/bookmarks/import). Once there, click the “Browse” button to locate your file. Then, take a moment to tag the imported links, decide if you want del.icio.us to automatically add popular tags, and also decide if existing bookmarks should be replaced or not. That’s it — click the “import now” button to import your links.

It is also worth mentioning that each file upload takes around a minute or so, depending on file size. You may wish to use the time to export the next set/category of Blogroll links. And finally, take advantage of the del.icio.us “export/backup” feature (https://secure.del.icio.us/settings/USERNAME/bookmarks/export) and backup your bookmarks!

References