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

---

# get_post_format_link( string $format ): string|󠀁[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)󠁿|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/get_post_format_link/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_post_format_link/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_post_format_link/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_post_format_link/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_post_format_link/?output_format=md#changelog)

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

Returns a link to a post format index.

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

 `$format`stringrequired

The post format slug.

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

 string|[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)|
false The post format term link.

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

    ```php
    function get_post_format_link( $format ) {
    	$term = get_term_by( 'slug', 'post-format-' . $format, 'post_format' );
    	if ( ! $term || is_wp_error( $term ) ) {
    		return false;
    	}
    	return get_term_link( $term );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/post-formats.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/post-formats.php#L149)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post-formats.php#L149-L155)

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

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

Generates a permalink for a taxonomy term archive.

  | 
| [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.

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

Checks whether the given variable is a WordPress Error.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/get_post_format_link/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_post_format_link/?output_format=md#)

| Used by | Description | 
| [WP_REST_Post_Format_Search_Handler::search_items()](https://developer.wordpress.org/reference/classes/wp_rest_post_format_search_handler/search_items/)`wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php` |

Searches the post formats for a given search request.

  | 
| [WP_REST_Post_Format_Search_Handler::prepare_item()](https://developer.wordpress.org/reference/classes/wp_rest_post_format_search_handler/prepare_item/)`wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php` |

Prepares the search result for a given post format.

  |

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

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

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