Function to list all post slugs for every post in wp_posts table?

I assume there's an official function to generate a post slug, but maybe someone here already has the answer.

link|improve this question
feedback

1 Answer

up vote 3 down vote accepted

example - unordered list with post slugs:

<ul>
  <?php foreach( get_posts('numberposts=-1') as $post ) { 
    echo '<li>' . $post->post_name . '</li>'; 
  } ?>
</ul>

http://codex.wordpress.org/Template_Tags/get_posts

link|improve this answer
1  
Thanks for the quick answer Michael. I'm actually moving posts out of WP so technically I'm not "in the loop". Surprisingly, I found the answer through Google Plus almost immediately after I posted the question: PJ Brunet - +Lloyd Budd I didn't see the slug in wp_posts, I'll check the_permalink() that's probably what I need. Lloyd Budd - +PJ Brunet the column is post_name. PJ Brunet - That worked. For example "select post_name from wp_posts LIMIT 500;" That's pretty much what I needed. – ferodynamics Jul 14 '11 at 21:08
reference to database tables: codex.wordpress.org/Class_Reference/wpdb#Tables – Michael Jul 14 '11 at 21:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.