Today we talk about WooCommerce or WordPress get post URL. In this tutorial, We focus on getting the blog post URL by post id. You can use the get_permalink function to get the post URL. You need to pass the blog post id to get the URL.
Let’s start with our example.
$postId = 1; // post id
$postUrl = get_permalink($postId)
$postUrl = get_permalink($postId)