My custom post type redirect to edit.php after publish and update post in wordpress


Staff member
I have created new custom post type - deals in wordpress and it is redirect to edit.php(posts listing) after the publish new deal post. so I want to redirect it to deals list page (<a href="" rel="nofollow"></a>) so please help me.

I tried this code but it redirect all posts type to specified page.

add_filter( 'redirect_post_location', 'wpse_124132_redirect_post_location' );
 * Redirect to the edit.php on post save or publish.

function wpse_124132_redirect_post_location( $location ) {

    if ( isset( $_POST['save'] ) || isset( $_POST['publish'] ) )
        return admin_url( "edit.php?post_type=deals" );

    return $location;