Title: format_for_editor
Published: August 18, 2015
Last modified: February 24, 2026

---

# apply_filters( ‘format_for_editor’, string $text, string $default_editor )

## In this article

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

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

Filters the text after it is formatted for the editor.

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

 `$text`string

The formatted text.

`$default_editor`string

The default editor for the current user.
 It is usually either `'html'` or `'tinymce'`.

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

    ```php
    return apply_filters( 'format_for_editor', $text, $default_editor );
    ```

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

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

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

Formats text for the editor.

  |

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

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

## User Contributed Notes

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