WordPress Bookmark

Beginner
4 min read
Updated: Nov 2026
2 examples
Links & blogroll

Definition

A WordPress bookmark is a saved link. It is part of the classic Links feature (also called the blogroll). Each bookmark has a name, a URL, and an optional description. You can put bookmarks in link categories.

Get one link with get_bookmark(). Get one value with get_bookmark_field(). Get many links with get_bookmarks(). Print a list with wp_list_bookmarks().

Where to find Links.

The Links screen is hidden on new WordPress sites. Install the Link Manager plugin to add and edit links in the admin area. Bookmarks are stored in the wp_links table.

Syntax

The four main bookmark functions:

WordPress
<?php
$link  = get_bookmark( 2 );                        // one link by ID
$name  = get_bookmark_field( 'link_name', 2 );     // one field of a link
$links = get_bookmarks( array( 'limit' => 5 ) );   // many links
wp_list_bookmarks();                               // print an HTML list
?>

Which Function Should I Use?

Pick the function that matches your job.

You want to…UseIt gives you
Read one link by IDget_bookmark()An object, an array, or null.
Read one value, such as the URLget_bookmark_field()A string.
Loop over many links yourselfget_bookmarks()An array of objects.
Print a ready-made HTML listwp_list_bookmarks()HTML (printed, or returned if echo is false).

WordPress Examples

Two short theme examples with sample output.

Example 1 — One link by ID

Get one link and print it as an HTML link.

WordPress
<?php
$link = get_bookmark( 2 );

if ( $link ) {
  echo '<a href="' . esc_url( $link->link_url ) . '">'
     . esc_html( $link->link_name ) . '</a>';
}
?>

How It Works

  1. get_bookmark( 2 ) returns the link with ID 2.
  2. The if check skips the code when the link is missing.
  3. esc_url() and esc_html() keep the output safe.

Example 2 — Print a list

Let WordPress print a flat list of your links.

WordPress
<?php
wp_list_bookmarks( array(
  'categorize'  => 0,
  'title_li'    => '',
  'show_images' => 0,
) );
?>

How It Works

  1. categorize => 0 makes one flat list.
  2. title_li => '' removes the heading.
  3. WordPress builds the HTML for you.

Next: WordPress Bookmark Functions Index

After you know the basics, open the functions index for all four guides.

Full list: WordPress Bookmark Functions index (/wordpress/bookmark/function).

Frequently Asked Questions

A bookmark is a saved link in the classic WordPress Links feature. It has a name, a URL, an optional description, and a link category. Many sites used it for a blogroll.
Use the Links screen in the admin area. The Links menu is hidden on new sites. Install the Link Manager plugin to bring it back.
Use it when you know the link ID and need that one link. It returns an object, an array, or null.
Use it when you need a list of links that you want to loop over yourself. You can sort, limit, and filter by link category.
Use it when you want WordPress to print a ready-made HTML list of links. It can group the links by link category.

Browse every bookmark function

Open the functions index for simple guides with examples and FAQs.

Bookmark Functions Index →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful