How to Get a List of All WordPress Post URLs

For some reasons you might need to get a list of WordPress post URLs to work with.

But WordPress doesn’t have any local function to record all the publish, web page and customized post URLs.

Definitely, you can duplicate personal URLs, but that strategy is time-consuming and is also really undesirable.

So, if you ever need, here is how you can have a list of all the WordPress publish URLs using a simple code and a plugin.

Get a List of URLs Manually

To manually get a list of all the post URLs in your WordPress site, create a new file into your site’s root directory named export.php and open it.

Once opened, copy and paste the below code into the file and save it.


include "wp-load.php";

$posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish');

$posts = $posts->posts;


foreach($posts as $post) {

   switch ($post->post_type) {

       case 'revision':

       case 'nav_menu_item':


       case 'page':

           $permalink = get_page_link($post->ID);


       case 'post':

           $permalink = get_permalink($post->ID);


       case 'attachment':

           $permalink = get_attachment_link($post->ID);



           $permalink = get_post_permalink($post->ID);



   echo "\n{$permalink}";

   //echo "\n{$post->post_type}\t{$permalink}\t{$post->post_title}";



Once done, open up your browser and enter the URL – in the address bar.

Now the uploaded file will be executed with the list of all the post URLs in your WordPress site.

Wordpress post URL

Note: don’t forget to delete the uploaded file as soon as you are done with it. This will help in restricting others from any unauthorized access.

Get a List of URLs with Plugin

The other way around is to use a easy plug-in known as List all URLs which is available in the formal WordPress repository.

You can set up it like any other WordPress plug-in and once set up, start “List all URLs” configurations web page under the “Settings” category.

Now choose the radio keys according to your specifications also choose the check box “Make the generated list of URLs clickable hyperlinks” if you want clickable hyperlinks.

You can chose the option “All URLs” so that “List all URLs” can place the URLs of all the content, webpages and custom post types.

Once you click the “Submit” button, this plugin will process all the URLs and will display them accordingly.

That’s all to do and it is so easy to list all the URLs in a WordPress website.

You may also like to know how to  download media library in WordPress. So, do check it out.

Give your opinion below if you experience any issues or to discuss your ideas and experiences.