Title: widget_text_content
Published: June 15, 2017
Last modified: May 20, 2026

---

# apply_filters( ‘widget_text_content’, string $text, array $instance, WP_Widget_Text $widget )

## In this article

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

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

Filters the content of the Text widget to apply changes expected from the visual(
TinyMCE) editor.

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

By default a subset of the_content filters are applied, including wpautop and wptexturize.

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

 `$text`string

The widget content.

`$instance`array

Array of settings for the current widget.

`$widget`[WP_Widget_Text](https://developer.wordpress.org/reference/classes/wp_widget_text/)

Current Text widget instance.

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

    ```php
    $text = apply_filters( 'widget_text_content', $text, $instance, $this );
    ```

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

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

| Used by | Description | 
| [WP_Widget_Text::widget()](https://developer.wordpress.org/reference/classes/wp_widget_text/widget/)`wp-includes/widgets/class-wp-widget-text.php` |

Outputs the content for the current Text widget instance.

  |

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

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

## User Contributed Notes

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