Title: pre_post_{$field}
Published: December 18, 2014
Last modified: May 20, 2026

---

# apply_filters( “pre_post_{$field}”, mixed $value )

## In this article

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

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

Filters the value of a specific field before saving.

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

Only applied to post fields with a name which is prefixed with `post_`.

The dynamic portion of the hook name, `$field_no_prefix`, refers to the post field
name minus the `post_` prefix. Possible filter names include:

 * `pre_post_ID`
 * `pre_post_comment_status`
 * `pre_post_ping_status`
 * `pre_post_to_ping`
 * `pre_post_pinged`
 * `pre_post_guid`
 * `pre_post_menu_order`
 * `pre_post_comment_count`

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

 `$value`mixed

Value of the post field.

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

    ```php
    $value = apply_filters( "pre_post_{$field}", $value );
    ```

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

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

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

Sanitizes a post field based on context.

  |

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

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

## User Contributed Notes

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