admin_url( string $path = '', string $scheme = 'admin' )

Retrieves the URL to the admin area for the current site.

Description Description

Parameters Parameters


(string) (Optional) path relative to the admin URL.

Default value: ''


(string) (Optional) The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.

Default value: 'admin'

Top ↑

Return Return

(string) Admin URL link with optional path appended.

Top ↑

Source Source

File: wp-includes/link-template.php

function admin_url( $path = '', $scheme = 'admin' ) {
	return get_admin_url( null, $path, $scheme );

Top ↑

Changelog Changelog

Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Codex


    <?php echo admin_url(); ?>

    Output: (or https protocol when appropriate)

    // Generate URL to admin's "Categories" page, and force https
    <?php echo admin_url( 'edit-tags.php?taxonomy=category', 'https' ); ?>


You must log in before being able to contribute a note or feedback.