Title: wp_internal_hosts
Published: March 29, 2023
Last modified: May 20, 2026

---

# apply_filters( ‘wp_internal_hosts’, string[] $internal_hosts )

## In this article

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

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

Filters the array of URL hosts which are considered internal.

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

 `$internal_hosts`string[]

An array of internal URL hostnames.

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

    ```php
    $internal_hosts = apply_filters(
    	'wp_internal_hosts',
    	array(
    		wp_parse_url( home_url(), PHP_URL_HOST ),
    	)
    );
    ```

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

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

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

Returns an array of URL hosts which are considered to be internal hosts.

  |

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

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

## User Contributed Notes

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