Title: PHP: Get post slug?
Last modified: August 19, 2016

---

# PHP: Get post slug?

 *  Resolved [onecrumb](https://wordpress.org/support/users/onecrumb/)
 * (@onecrumb)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/php-get-post-slug/)
 * How do I get the slug URL of a post? Just the name of the function is all I need.
 * Thank you.

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

 *  [ianternet](https://wordpress.org/support/users/ianternet/)
 * (@ianternet)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/php-get-post-slug/#post-820448)
 * i need this as well – anyone with an idea? my brain hurts too much from over 
   thinking and reading wordpress… any one has insgihts?
 *  [jstnjns](https://wordpress.org/support/users/jstnjns/)
 * (@jstnjns)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/php-get-post-slug/#post-820518)
 * Has **anybody** figured this out?
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/php-get-post-slug/#post-820519)
 * Inside the loop..
    `<?php echo $post->post_name;?>`
 * Maybe misleading i know, but that does refer to the slug of the post..

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

The topic ‘PHP: Get post slug?’ is closed to new replies.

## Tags

 * [post-slug](https://wordpress.org/support/topic-tag/post-slug/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 4 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/php-get-post-slug/#post-820519)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
