Title: post_states_html
Published: February 24, 2026

---

# apply_filters( ‘post_states_html’, string $post_states_html, array<string, , WP_Post $post )

## In this article

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

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

Filters the HTML string of post states.

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

 `$post_states_html`string

All relevant post states combined into an HTML string for display.
 E.g. `&mdash;
<span class='post-state'>Draft, </span><span class='post-state'>Sticky</span>`.

string> $post_states A mapping of post state slugs to translated post state labels.

E.g. `array( 'draft' => __( 'Draft' ), 'sticky' => __( 'Sticky' ), ... )`.

`$post`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)

The current post object.

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

    ```php
    $post_states_html = apply_filters( 'post_states_html', $post_states_html, $post_states, $post );
    ```

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

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

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

Echoes or returns the post states as HTML.

  |

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

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

## User Contributed Notes

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