Title: _wp_has_noncharacters_fallback
Published: February 24, 2026

---

# _wp_has_noncharacters_fallback( string $text ): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/_wp_has_noncharacters_fallback/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/_wp_has_noncharacters_fallback/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/_wp_has_noncharacters_fallback/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/_wp_has_noncharacters_fallback/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/_wp_has_noncharacters_fallback/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_wp_has_noncharacters_fallback/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_wp_has_noncharacters_fallback/?output_format=md#changelog)

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

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Fallback support for determining if a string contains Unicode noncharacters.

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

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

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

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

 `$text`stringrequired

Are there noncharacters in this string?

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

 bool Whether noncharacters were found in the string.

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

    ```php
    function _wp_has_noncharacters_fallback( string $text ): bool {
    	$at                = 0;
    	$invalid_length    = 0;
    	$has_noncharacters = false;
    	$end               = strlen( $text );

    	while ( $at < $end && ! $has_noncharacters ) {
    		_wp_scan_utf8( $text, $at, $invalid_length, null, null, $has_noncharacters );
    		$at += $invalid_length;
    	}

    	return $has_noncharacters;
    }
    ```

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

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

| Uses | Description | 
| [_wp_scan_utf8()](https://developer.wordpress.org/reference/functions/_wp_scan_utf8/)`wp-includes/compat-utf8.php` |

Finds spans of valid and invalid UTF-8 bytes in a given string.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_wp_has_noncharacters_fallback/?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%2Ffunctions%2F_wp_has_noncharacters_fallback%2F)
before being able to contribute a note or feedback.