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

---

# __return_true(): true

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#see-also)
 * [Return](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#return)
 * [More Information](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#changelog)

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

Returns true.

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

Useful for returning true to filters easily.

### 󠀁[See also](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#see-also)󠁿

 * [__return_false()](https://developer.wordpress.org/reference/functions/__return_false/)

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

 true True.

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#more-information)󠁿

##### 󠀁[Usage:](https://developer.wordpress.org/reference/functions/__return_true/?output_format=md#usage)󠁿

    ```php
    <?php
    // This will add a filter on `example_filter` that returns true
    add_filter( 'example_filter', '__return_true' );
    ?>
    ```

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

    ```php
    function __return_true() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
    	return true;
    }
    ```

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

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

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

## User Contributed Notes

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