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

---

# get_linkrating( object $link ): mixed

## In this article

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

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

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

Legacy function that retrieved the value of a link’s link_rating field.

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

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

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

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

 `$link`objectrequired

Link object.

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

 mixed Value of the `'link_rating'` field, false otherwise.

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

    ```php
    function get_linkrating( $link ) {
    	_deprecated_function( __FUNCTION__, '2.1.0', 'sanitize_bookmark_field()' );
    	return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display');
    }
    ```

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

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

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

Sanitizes a bookmark field.

  | 
| [_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_links()](https://developer.wordpress.org/reference/functions/get_links/)`wp-includes/deprecated.php` |

Gets the links associated with category by ID.

  |

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

| Version | Description | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Deprecated. Use [sanitize_bookmark_field()](https://developer.wordpress.org/reference/functions/sanitize_bookmark_field/)  | 
| [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_linkrating%2F)
before being able to contribute a note or feedback.