WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use this function and hook:

function mysite_admin_menu() 
  add_menu_page( 'Categories', 'Catégories', 'administrator', 'categories', 'a_function' );
  add_submenu_page( 'categories', 'Manage', 'Manage', 'administrator', 'xxx', 'a_function' );
add_action( 'admin_menu', 'mysite_admin_menu' );

It displays what I need: a menu with a submenu on the left admin menu bar.

The thing is, the submenu leads to this page: admin.php?page=xxx.

How can I do to link to a URL like edit-tags.php?taxonomy=category?

If I swap the slug in the add_submenu_page with a relative URL, the link will lead to admin.php?page=edit-tags.php?taxonomy=category.

Whatever I do, I always get admin.php?page=... which is not what I want.

share|improve this question
see updated example =) – qwerty qwerty Jan 31 '13 at 6:02

This is an old post but can't you just use wordpress $menu and/or $submenu globals like Oleg suggested in number 2.

When in doubt copy WordPress:


For example to add link this seems like it would work:

function add_external_link_admin_submenu() {
    global $submenu;
    $permalink = admin_url( 'edit-tags.php' ).'?taxonomy=category';
    $submenu['options-general.php'][] = array( 'Manage', 'manage_options', $permalink );
add_action('admin_menu', 'add_external_link_admin_submenu');

You can replace the $permalink = ... with anything

So this should also work :

$permalink = 'http://www.example.com';

Also, it's suggested not to use 'administrator' (even though I use it as well. Anyway, read this ticket for alternative solutions.

share|improve this answer

Firstly, not recoment you do that.


lets assume your prefix for admin.php is '_trigger_me_'

  1. Submenu

    function _clean_url_to_repalce_admin_menu($url, $original_url, $_context){
        if ($url == 'admin.php?page=_trigger_me_'){
            remove_filter('clean_url', '_clean_url_to_repalce_admin_menu', 10);
            //return admin_url('someotherpage.php);
            return 'http://google.com/';
    if (is_admin())
    add_filter('clean_url', '_clean_url_to_repalce_admin_menu', 10, 3);
  2. Main Menu

    function custom_admin_menu_action_hook(){
        global $menu;
        foreach($menu as $k=>$item){
            if ($item[2] == '_trigger_me_'){
                    $menu[$k][2] = 'http://google.com';
    add_action('admin_menu', 'custom_admin_menu_action_hook', 100);

I call both examples as "hacks". Thay posible to do, but better to not do that.


if case if satisfied with redirection =)

$hook = add_submenu_page($parent, $title, $menu_title, 'manage_option', 'callback');
add_action("load-{$hook}", create_function('','
    header("Location:", admin_url("someurl.php?blahblahblah"));

in case if you want to substitute this by taxonomy page (edit-tags.php)

add_action('admin_menu', 'admin_menu_edit_tags_page');
function admin_menu_edit_tags_page(){
    // please set $YOURPARENTSLUG as parent slug of your menu item (parent of your menu)
    // manage_tags to manage_terms of your taxonomy capability (its visible whan you var_dump($wp_taxonomies[$taxonomyyouwant]));
    add_submenu_page($YOURPARENTSLUG, 'menu', 'title', 'manage_tags',  'edit-tags.php?taxonomy=taxonomy');
share|improve this answer

Thank you Oleg, your script works but breaks the admin interface (background colors and images all dissappear for any reason).

But if I have to take this road, I can do this instead:

function changeUrl()
    $pageURL = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

    if ($pageURL == 'http://www.mysite.com/wp-admin/admin.php?page=xxxx')
        header ('location:http://www.mysite.com/wp-admin/edit-tags.php?taxonomy=category');
add_action( 'admin_menu', 'changeUrl' );

It's seems curious to me that there is no simple way to link a submenu to any url. This kind of redirection is messy...but it works.

share|improve this answer

Readadd_menu_page carefully:


(string) (required) The slug name to refer to this menu by (should be unique for this menu). Prior to Version 3.0 this was called the file (or handle) parameter. If the function parameter is omitted, the menu_slug should be the PHP file that handles the display of the menu page content.

Default: None

share|improve this answer

Although this is an old problem, I'd like to contribute for consideration this code:

function mysite_admin_menu() 
  add_menu_page( 'Categories', 'Catégories', 'administrator', 'categories', 'a_function' );
  add_submenu_page( 'categories', 'Manage', 'Manage', 'administrator', 'manage_categories', 'mysite_manage_categories' );
add_action( 'admin_menu', 'mysite_admin_menu' );

function mysite_manage_categories() 

?><script>window.location = "<?php echo admin_url('edit-tags.php?taxonomy=category'); ?>";</script><?php 

it uses javascript redirect instead of creating another add_action to redirect via http.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.