WordPress at Your Fingertips

site_url() WP 1.0

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

Returns the site_url with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is overridden.

1 time — 0.00026 sec (fast) | 50000 times — 7.44 sec (fast)

No Hooks.


String. Site URL link with optional path appended.


site_url( $path, $scheme );
Path relative to the site URL.
Default: ''
Scheme to give the site URL context. See set_url_scheme().
Default: null


Since 3.0.0 Introduced.

Code of site_url() WP 5.8.1

function site_url( $path = '', $scheme = null ) {
	return get_site_url( null, $path, $scheme );

Link (URL)

Site Options (settings)

Links (URL)

No comments
    Log In