Title: get_linkobjectsbyname
Published: April 25, 2014
Last modified: February 24, 2026

---

# get_linkobjectsbyname( string $cat_name, string $orderby, int $limit = -1 ): array

## In this article

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

[ Back to top](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?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 $cat_name.

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

$links = get_linkobjectsbyname( ‘fred’ ); foreach ( $links as $link ) { echo ‘

  ‘ . $link->link_name . ‘
  ‘; }
  
  ### 󠀁[See also](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?output_format=md#see-also)󠁿
  
   * [get_bookmarks()](https://developer.wordpress.org/reference/functions/get_bookmarks/)
  
  ## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?output_format=md#parameters)󠁿
  
   `$cat_name`stringoptional
  The category name to use. If no match is found, uses all.
   Default `'noname'`.
  `$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.
  `$limit`intoptional
  Limit to X entries. If not specified, all entries are shown.
  Default:`-1`
  
  ## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?output_format=md#return)󠁿
  
   array
  
  ## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?output_format=md#source)󠁿
  
      ```php
      function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
      	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
  
      	$cat_id = -1;
      	$cat = get_term_by('name', $cat_name, 'link_category');
      	if ( $cat )
      		$cat_id = $cat->term_id;
  
      	return get_linkobjects($cat_id, $orderby, $limit);
      }
      ```
  
  [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
  [View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/deprecated.php#L467)
  [View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/deprecated.php#L467-L476)
  
  ## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?output_format=md#related)󠁿
  
  | Uses | Description | 
  | [get_linkobjects()](https://developer.wordpress.org/reference/functions/get_linkobjects/)`
  wp-includes/deprecated.php` |
  Gets an array of link objects associated with category n.
    | 
  | [get_term_by()](https://developer.wordpress.org/reference/functions/get_term_by/)`
  wp-includes/taxonomy.php` |
  Gets all term data from database by term field and data.
    | 
  | [_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.
    |
  [Show 1 more](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?output_format=md#)
  [Show less](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?output_format=md#)
  
  ## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_linkobjectsbyname/?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_linkobjectsbyname%2F)
  before being able to contribute a note or feedback.