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

How can I add a sub menu link using add_submenu_page that will open a new window (target="_blank") instead of opening in the current one (default behavior)?

share|improve this question
A good question :) Any help on this? – diosney Sep 23 '12 at 20:35
up vote 1 down vote accepted

This has to be solved:

  • with an unconventional submenu manipulation, provided by @t31os in this Answer
  • and some jQuery
add_action( 'admin_menu', 'wpse_66020_admin_menu_new_item' );
add_action( 'admin_head', 'wpse_66020_add_jquery' );

function wpse_66020_admin_menu_new_item() 
    global $submenu;
    $submenu['index.php'][500] = array( 
                                    '<div id="wpse-66020">Go to WPSE</div>'
                                ,   'manage_options' 
                                ,   'http://wordpress.stackexchange.com/' 

function wpse_66020_add_jquery() 
    <script type="text/javascript">
        jQuery(document).ready( function($) {   

Resulting in this:

submenu with _blank target
click to enlarge

share|improve this answer
thanks, I will check and let you know – leticia Nov 17 '12 at 14:12

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.