How to get wordpress page url or link by page or post name

to get the URL of a page by its name in WordPress first you need to get the id of the page by page name and then you have to get the page URL by id

Now to get the id of the page by page name use the below code
$page = get_page_by_title( ‘Hellow World’ );
$page_id = $page->ID;

Then call the function get_page_link() and pass the post id through the function and print it and you will get the id

Now here is the full code


ID; ?>

Thanks for Reading

Share The Post On -

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.