Title: get_linkobjects
Published: April 25, 2014
Last modified: May 20, 2026

---

# get_linkobjects( int $category, string $orderby = 'name', int $limit ): array

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#wp--skip-link--target)

This function has been deprecated since 2.1.0. Use [get_bookmarks()](https://developer.wordpress.org/reference/functions/get_bookmarks/)
instead.

Gets an array of link objects associated with category n.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#description)󠁿

Usage:

    ```php
    $links = get_linkobjects(1);
    if ($links) {
        foreach ($links as $link) {
            echo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>';
        }
    }
    ```

Fields are:

 * link_id
 * link_url
 * link_name
 * link_image
 * link_target
 * link_category
 * link_description
 * link_visible
 * link_owner
 * link_rating
 * link_updated
 * link_rel
 * link_notes

### 󠀁[See also](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#see-also)󠁿

 * [get_bookmarks()](https://developer.wordpress.org/reference/functions/get_bookmarks/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#parameters)󠁿

 `$category`intoptional

The category to use. If no category supplied, uses all.
 Default 0.

`$orderby`stringoptional

The order to output the links. E.g. `'id'`, `'name'`, `'url'`, `'description'`, `'
rating'`, or `'owner'`. Default `'name'`.
 If you start the name with an underscore,
the order will be reversed. Specifying `'rand'` as the order will return links in
a random order.

Default:`'name'`

`$limit`intoptional

Limit to X entries. If not specified, all entries are shown.
 Default 0.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#return)󠁿

 array

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#source)󠁿

    ```php
    function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) {
    	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );

    	$links = get_bookmarks( array( 'category' => $category, 'orderby' => $orderby, 'limit' => $limit ) ) ;

    	$links_array = array();
    	foreach ($links as $link)
    		$links_array[] = $link;

    	return $links_array;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/deprecated.php#L522)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/deprecated.php#L522-L532)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#related)󠁿

| Uses | Description | 
| [get_bookmarks()](https://developer.wordpress.org/reference/functions/get_bookmarks/)`wp-includes/bookmark.php` |

Retrieves the list of bookmarks.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  |

| Used by | Description | 
| [get_linkobjectsbyname()](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/)`wp-includes/deprecated.php` |

Gets an array of link objects associated with category $cat_name.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_linkobjects/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Deprecated. Use [get_bookmarks()](https://developer.wordpress.org/reference/functions/get_bookmarks/)  | 
| [1.0.1](https://developer.wordpress.org/reference/since/1.0.1/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_linkobjects%2F)
before being able to contribute a note or feedback.