Title: How to get the parent page permalink
Last modified: August 19, 2016

---

# How to get the parent page permalink

 *  [alturo](https://wordpress.org/support/users/alturo/)
 * (@alturo)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/parent-permalink/)
 * Hi,
 * When I’m in a subpage I’m getting the parent page title using something like 
   that:
 * `$parent_title = get_the_title($post->post_parent); echo $parent_title;`
 * I’m looking for a tip to link the parent title with the parent page permalink.
 * Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/parent-permalink/#post-1119634)
 * [get_page_by_title](http://codex.wordpress.org/Function_Reference/get_page_by_title)?
 *  Thread Starter [alturo](https://wordpress.org/support/users/alturo/)
 * (@alturo)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/parent-permalink/#post-1119681)
 * I don’t see the way to get the permalink using get_page_by_title, Could you plese
   be more specific?
 * Thanks!
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/parent-permalink/#post-1119729)
 *     ```
       $parent = get_page_by_title($parent_title);
       $parent_link = '<a href="'.$parent->guid.'">'.$parent_title.'</a>'
       ```
   
 *  [mariostella](https://wordpress.org/support/users/mariostella/)
 * (@mariostella)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/parent-permalink/#post-1119951)
 * [@esmi](https://wordpress.org/support/users/esmi/)‘ I get the correct parent 
   url but unfortunately it’s got the ‘.$parent_title.’ attached to the end of it
   rendering it a broken link.
 *  [psound](https://wordpress.org/support/users/psound/)
 * (@psound)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/parent-permalink/#post-1120051)
 * Try this:
 *     ```
       <?php $permalink = get_permalink($post->post_parent); ?>
       <a href="<?php echo $permalink; ?>"Parent</a>
       ```
   
 *  [scormeny](https://wordpress.org/support/users/scormeny/)
 * (@scormeny)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/parent-permalink/#post-1120059)
 * I used the code that PSound gave, though please note it needs one fix for a typo:
 *     ```
       <?php $permalink = get_permalink($post->post_parent); ?>
       <a href="<?php echo $permalink; ?>">Parent</a>
       ```
   
 * Thanks, PSound!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘How to get the parent page permalink’ is closed to new replies.

## Tags

 * [page](https://wordpress.org/support/topic-tag/page/)
 * [parent](https://wordpress.org/support/topic-tag/parent/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [subpage](https://wordpress.org/support/topic-tag/subpage/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 5 participants
 * Last reply from: [scormeny](https://wordpress.org/support/users/scormeny/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/parent-permalink/#post-1120059)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
