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

---

# get_linksbyname( string $cat_name, string $before, string $after, string $between, bool $show_images = true, string $orderby, bool $show_description = true, bool $show_rating = false, int $limit = -1, int $show_updated )

## In this article

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

[ Back to top](https://developer.wordpress.org/reference/functions/get_linksbyname/?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 the links associated with category $cat_name.

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

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

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

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

 `$cat_name`stringoptional

The category name to use. If no match is found, uses all.
 Default `'noname'`.

`$before`stringoptional

The HTML to output before the link. Default empty.

`$after`stringoptional

The HTML to output after the link. Default `<br />`.

`$between`stringoptional

The HTML to output between the link/image and its description.
 Not used if no image
or $show_images is true. Default ‘ ‘.

`$show_images`booloptional

Whether to show images (if defined).

Default:`true`

`$orderby`stringoptional

The order to output the links. E.g. `'id'`, `'name'`, `'url'`, `'description'`, `'
rating'`, or `'owner'`. Default `'id'`.
 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.

`$show_description`booloptional

Whether to show the description if show_images=false/not defined.

Default:`true`

`$show_rating`booloptional

Show rating stars/chars.

Default:`false`

`$limit`intoptional

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

Default:`-1`

`$show_updated`intoptional

Whether to show last updated timestamp. Default 0.

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

    ```php
    function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id',
    						$show_description = true, $show_rating = false,
    						$limit = -1, $show_updated = 0) {
    	_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;

    	get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);
    }
    ```

[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#L402)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/deprecated.php#L402-L413)

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

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

Gets the links associated with category by ID.

  | 
| [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_linksbyname/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_linksbyname/?output_format=md#)

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

Gets the links associated with category ‘cat_name’ and display rating stars/chars.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_linksbyname/?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/)  | 
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |

## User Contributed Notes

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