wordpress get page url by id

Today we talk about WordPress get the page URL. In this tutorial. First you need the page id to get the page url. We will use get_page_link function to get page url.
Let’s start with our example.

$pageId =  40;
$pageUrl = esc_url( get_page_link( $pageId ) );

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!