Skip to main content
Blog

Adding a Custom Link to Custom Post Type WordPress Admin Submenu

Recently I had a situation where I wanted to add a submenu item to a custom post type within the WordPress admin that pointed to a completely separate area of the admin where they could find form entries related to that custom post type. That was my particular use case but you could take this route if needing to add any existing URL to a CPT submenu within the WordPress admin.


add_action('admin_menu', 'klf_add_custom_link_into_cpt_menu');
function klf_add_custom_link_into_cpt_menu() {
global $submenu;

// replace this URL with what you want to add
$link = 'https://www.kristinfalkner.com';

// switch events with your post type slug and Link Title with desired label
$submenu['edit.php?post_type=events'][] = array( 'Link Title', 'manage_options', $link );
}

QUICK CONNECT

  • This field is for validation purposes and should be left unchanged.