Family Encyclopedia >> Electronics

How to Customize and Organize Your WordPress Blogroll Links

Many WordPress themes include default blogroll code in the sidebar, displaying links in alphabetical order with little control. As experienced WordPress developers, we've helped countless sites gain full command over their link organization. In this guide, we'll walk you through customizing your blogroll display.

Important Update: The Link Manager was removed in WordPress 3.5. We strongly recommend switching to WordPress menus, which offer far greater flexibility. See details in this article.

The standard code looks like this:

<?php wp_list_bookmarks(); ?>

This pulls all links and sorts them alphabetically. To display only links from a specific category, first create a category in your WordPress Admin Panel under Links, add your links, and note the category ID.

Update the code like so:

<?php wp_list_bookmarks('category=2'); ?>

Replace 2 with your category ID. You can now place this anywhere in your theme templates. Take it further with additional parameters for precise control.

Use the orderby parameter with these options:

  • 'ID'
  • 'url'
  • 'name'
  • 'target'
  • 'description'
  • 'owner' (user who added the link)
  • 'classification'
  • 'updated'
  • 'rel' (XFN relationship)
  • 'notes'
  • 'rss'
  • 'length' (shortest to longest name)
  • 'rand' (random order)

Example for category 2, ordered by ID in ascending order:

<?php wp_list_bookmarks('category=2&orderby=ID&order=ASC'); ?>

Switch to descending order:

<?php wp_list_bookmarks('category=2&orderby=ID&order=DESC'); ?>

WordPress defaults to ascending. Explore more options in the WordPress Codex for advanced customization.