Support » Fixing WordPress » How To Export / Create List Of All My Blog Post URL's?

  • Resolved jasonpel



    Does anyone know how to export or create a list of all post URL’s contained on a blog? I have literally 100’s of posts and I would like to create a simple list of all of their URL’s. Is there a script or plugin that can automate this?


Viewing 15 replies - 1 through 15 (of 15 total)
  • Drew Jaynes


    WordPress Core Developer

    You might try something like this.

    It seems like there isn’t a streamlined way to accomplish this short of the method I linked above or exporting posts to a csv and manually removing columns.



    <ul class="archives">
    	<?php wp_get_archives( array( 'type' => 'postbypost' ) ); ?>
    </ul><!-- .archives -->

    If you create a page template (e.g. list-posts.php) and put the above code in the main content section, you should get your list of posts.

    Thanks Drew!


    Is there a way to get a list of urls like:



    Sorry, can’t see anything there, Jason.

    Page Not Found – 404 Error Page
    The page you are looking for ( is not here.

    You can limit the number of posts shown in such a list to just the latest 30 or 50 or whatever – I’ve used the following code to list posts + number of comments in the sidebar of an archives page:

    <h3>Last 50 Articles</h3>
    showing comments per post<br />
    <?php query_posts('showposts=50'); ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a> - (<?php echo $post->comment_count ?>)</li>
    <?php endwhile; endif; ?>



    Forum Moderator

    I think jasonpel is looking for a list of urls in the format



    d’oh – I see what you mean.

    You should be able to modify the code above to just list the permalinks without adding the title stuff.

    <h3>Last 50 Articles</h3>
    <?php query_posts('showposts=50'); ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<li><?php the_permalink() ?></li>
    <?php endwhile; endif; ?>

    {edited to correct code – a couple of extraneous characters hadn’t been removed from previous more complicated code)

    tigtog, awesome! but is it possible to list ALL posts urls with the title separated by a comma?

    Like:,Sample Post

    And is it possible to create a page template and appy it to only one page so that all of the other pages on the site retain their original format?

    Thanks for your help! 🙂

    thank you tigtog! works great… 🙂

    Hi jasonpel,
    sounds like you may have received some further assistance with this? Did you get it to a point where it showed all Urls with full title. If so please share, I need that exact thing right now.

    hey jasonpel or mgason,

    i’m interested in the same, can you share any additional help you received.


    It depends what you want to do with it.
    I did not add it to a page and style it. You could easily.
    I just had it load raw to my browser window, a big list. Then I did a copy and paste and imported into Excel. My client just wanted a list he could check when moving his site.
    The code is below, if it does not paste properly to comments here post again and give me an email. I will send you a file.

    To run this you just make it a php file, say export.php, then put that in the root of your site. Go to a browser and type
    The list will appear in the browser.
    To also list images and attachments uncomment the global block near the top. As it is it gives you post type, url, title

    [Code moderated as per the Forum Rules. Please use the pastebin]

    To import to Excel,
    copy and paste from browser to a plain text file,
    save that as a someName.csv
    Then in Excel, file new,
    select import on file menu,
    select csv as the type,
    select your file,
    select delimited, click next
    select Tab as the only delimiter, click next
    select each column in the data preview on dialog box and set column data format = text for each, when you have done all of the columns click next
    click finish
    click ok on last dialog.

    mgason, thanks! can you please post code to pastebin?

    ignore the original comment about changing code blocks, I updated the code so you just change 1 word to also list images. Explained in comments in code

    @mgason – cool, i copied the raw code and pasted it to a php file, uploaded it to the root folder, opened it in a browser, and it worked great!


Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How To Export / Create List Of All My Blog Post URL's?’ is closed to new replies.