custom permalink for post only not custom post types

ok so after searching again i found this and it worked

/**
 * Add new rewrite rule
 */
function create_new_url_querystring() {
    add_rewrite_rule(
        'recipes/([^/]*)$',
        'index.php?name=$matches[1]',
        'top'
    );
    add_rewrite_tag('%recipes%','([^/]*)');
}
add_action('init', 'create_new_url_querystring', 999 );
/**
 * Modify post link
 * This will print /recipes/post-name instead of /post-name
 */
function append_query_string( $url, $post, $leavename ) {
    if ( $post->post_type == 'post' ) {     
        $url = home_url( user_trailingslashit( "recipes/$post->post_name" ) );
    }
    return $url;
}
add_filter( 'post_link', 'append_query_string', 10, 3 );
/**
 * Redirect all posts to new url
 * If you get error 'Too many redirects' or 'Redirect loop', then delete everything below
 */
function redirect_old_urls() {
    if ( is_singular('post') ) {
        global $post;
        if ( strpos( $_SERVER['REQUEST_URI'], '/recipes/') === false) {
           wp_redirect( home_url( user_trailingslashit( "recipes/$post->post_name" ) ), 301 );
           exit();
        }
    }
}
add_filter( 'template_redirect', 'redirect_old_urls' );

link to the full post can be found a link here.