WordPress Bookmark Functions

Index
About This Index
This page is the WordPress Bookmark Functions index. Each row links to a full guide with syntax, examples, and FAQs.
Learn what bookmarks are on WordPress Bookmark. Use this page when you need one function, such as get_bookmark(), get_bookmarks(), or wp_list_bookmarks().
Beginner path.
Start with get_bookmark(), then get_bookmark_field(), get_bookmarks(), and wp_list_bookmarks().
Syntax
How to Call a Bookmark Function
Bookmarks are saved links. Functions that start with get_ return data. wp_list_bookmarks() prints an HTML list.
WordPress
<?php
$one = get_bookmark( 2 ); // one link (object)
$name = get_bookmark_field( 'link_name', 2 ); // one field (string)
$links = get_bookmarks( array( 'limit' => 5 ) ); // many links (array)
wp_list_bookmarks( array( 'categorize' => 0 ) ); // prints an HTML list
?> Browse
WordPress Bookmark Functions Table
All function guides in this WordPress bookmark series (4 tutorials).
Get one bookmark
2 functionsRead one link by ID, or read one field of a link.
| Function | Description | Tutorial |
|---|---|---|
get_bookmark() | Get one bookmark (link) by ID. | Read guide |
get_bookmark_field() | Get one field of a bookmark, such as its name or URL. | Read guide |
Get many & display a list
2 functionsGet an array of links, or print a ready-made HTML list.
| Function | Description | Tutorial |
|---|---|---|
get_bookmarks() | Get a list of bookmarks as an array of objects. | Read guide |
wp_list_bookmarks() | Print an HTML list of bookmarks. | Read guide |
Frequently Asked Questions
They are PHP functions that work with bookmarks, also called links or the blogroll. A bookmark is a saved link with a name, a URL, and a description. You can get one link, get many links, or print an HTML list.
They are stored in the wp_links table. You manage them on the Links screen, and you group them with link categories. New sites hide this screen until you install the Link Manager plugin.
Use get_bookmark() to get one link by ID. Use get_bookmark_field() when you only need one value, such as the name or the URL.
Use get_bookmarks(). It returns an array of link objects that you can sort, filter, and loop over.
Use wp_list_bookmarks(). It builds and prints an HTML list for you. Set echo to false if you want the HTML returned as a string.
Start with get_bookmark(), then learn get_bookmark_field(), get_bookmarks(), and wp_list_bookmarks().
Start with get_bookmark()
Get one bookmark by ID, the first guide in the sidebar.
6 people found this page helpful
