I know how to use capabilities to remove the "Add New" functionality for a custom post type, but what I really need to do is change the target of those links. Does anyone know how I might go about doing that?

I would be an "external" link (to the front end of the website) and not a page on wp-admin.

1 Answer 1


in most of the case WordPress ui uses admin_url() function to retrieve administrative urls. so you can use admin_url filter to modify that.


add_filter( 'admin_url', 'wpse_271288_change_add_new_link_for_post_type', 10, 2 );
function wpse_271288_change_add_new_link_for_post_type( $url, $path ){
    if( $path === 'post-new.php?post_type=your_custom_post_type' ) {
        $url = get_permalink(/*your post ID here*/); // or any other url
    return $url;

Change your_custom_post_type with your custom post type name.

Reference (WordPress Version 4.8): edit.php (Line No. 312) and link-template.php (Line No. 3132)

  • 1
    glad it worked! don't forget to check user's role/permission before allow them to create/edit content from your custom form... :) Commented Jun 25, 2017 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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