Function to list all post slugs for every post in my WP database?

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.

1 Answer
1

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

Leave a Comment