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

---

# apply_filters( ‘site_url’, string $url, string $path, string|null $scheme, int|null $blog_id )

## In this article

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

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

Filters the site URL.

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

 `$url`string

The complete site URL including scheme and path.

`$path`string

Path relative to the site URL. Blank string if no path is specified.

`$scheme`string|null

Scheme to give the site URL context. Accepts `'http'`, `'https'`, `'login'`, `'login_post'`,`'
admin'`, `'relative'` or null.

`$blog_id`int|null

Site ID, or null for the current site.

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

    ```php
    return apply_filters( 'site_url', $url, $path, $scheme, $blog_id );
    ```

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

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

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

Checks whether the current site’s URL where WordPress is stored is using HTTPS.

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

Retrieves the URL for a given site where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.

  |

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

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

## User Contributed Notes

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