site_url ( $path = '', $scheme = null )

  • (string) path Optional. Path relative to the site URL. Default empty.
  • (string|null) scheme Optional. Scheme to give the site URL context. See set_url_scheme().
  • (string) Site URL link with optional path appended.
Defined at:


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' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is overridden.

Related Functions

sanitize_url, get_site_url, site_icon_url, get_sitemap_url, esc_url

Top Google Results

User discussions

wpseek mobile