Skip to main content

Adding a Submenu Custom Link to Custom Post Type WordPress Menu

WordPress Tutorials | November 6th, 2017

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 = '';

// 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 );
Copy link