{"id":3586,"date":"2016-03-16T08:13:28","date_gmt":"2016-03-16T08:13:28","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=3586"},"modified":"2021-02-06T06:09:29","modified_gmt":"2021-02-06T06:09:29","slug":"get-list-wordpress-post-urls","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/","title":{"rendered":"How to Get a List of All WordPress Post URLs"},"content":{"rendered":"<p>For some reasons you might need to get a list of WordPress post URLs to work with.<\/p>\n<p>But WordPress doesn\u2019t have any local function to record all the publish, web page and customized post URLs.<!--more--><\/p>\n<p>Definitely, you can duplicate personal URLs, but that strategy is time-consuming and is also really undesirable.<\/p>\n<p>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.<\/p>\n<h2>Get a List of URLs Manually<\/h2>\n<p>To manually get a list of all the post URLs in your WordPress site, create a new file into your site\u2019s root directory named\u00a0<strong><em>export.php<\/em> <\/strong>and open it.<\/p>\n<p>Once opened, copy and paste the below code into the file and save it.<\/p>\n<div class=\"cpanel-files\"><\/div>\n<pre class=\"lang:default decode:true \">&lt;?php\r\n\r\ninclude \"wp-load.php\";\r\n\r\n$posts = new WP_Query('post_type=any&amp;posts_per_page=-1&amp;post_status=publish');\r\n\r\n$posts = $posts-&gt;posts;\r\n\r\nheader('Content-type:text\/plain');\r\n\r\nforeach($posts as $post) {\r\n\r\n   switch ($post-&gt;post_type) {\r\n\r\n       case 'revision':\r\n\r\n       case 'nav_menu_item':\r\n\r\n           break;\r\n\r\n       case 'page':\r\n\r\n           $permalink = get_page_link($post-&gt;ID);\r\n\r\n           break;\r\n\r\n       case 'post':\r\n\r\n           $permalink = get_permalink($post-&gt;ID);\r\n\r\n           break;\r\n\r\n       case 'attachment':\r\n\r\n           $permalink = get_attachment_link($post-&gt;ID);\r\n\r\n           break;\r\n\r\n       default:\r\n\r\n           $permalink = get_post_permalink($post-&gt;ID);\r\n\r\n           break;\r\n\r\n   }\r\n\r\n   echo \"\\n{$permalink}\";\r\n\r\n   \/\/echo \"\\n{$post-&gt;post_type}\\t{$permalink}\\t{$post-&gt;post_title}\";\r\n\r\n}\r\n\r\n?&gt;<\/pre>\n<p>Once done, open up your browser and\u00a0enter the URL \u2013\u00a0<strong><em>http:\/\/yourdomain.com\/export.php<\/em><\/strong>\u00a0in the address bar.<\/p>\n<p>Now the uploaded file will be executed with the list of all the post URLs in your WordPress site.<\/p>\n<p><a href=\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/wordpress-post-url\/\" rel=\"attachment wp-att-3588\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-3588 pleslwp\" src=\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/Wordpress-post-URL.jpg\" alt=\"Wordpress post URL\" width=\"624\" height=\"220\" srcset=\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/Wordpress-post-URL.jpg 624w, https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/Wordpress-post-URL-300x106.jpg 300w, https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/Wordpress-post-URL-320x113.jpg 320w, https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/Wordpress-post-URL-239x84.jpg 239w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p><strong>Note<\/strong>: don\u2019t forget to delete the uploaded file as soon as you are done with it. This will help in restricting others from any unauthorized access.<\/p>\n<h2>Get a List of URLs with Plugin<\/h2>\n<p>The other way around is to use a easy plug-in known as <strong>List all URLs<\/strong> which is available in the formal WordPress repository.<\/p>\n<p>You can set up it like any other WordPress plug-in and once set up, start \u201cList all URLs\u201d configurations web page under the \u201cSettings\u201d category.<\/p>\n<p>Now choose the radio keys according to your specifications also choose the check box \u201c<strong>Make the generated list of URLs clickable hyperlinks<\/strong>\u201d if you want clickable hyperlinks.<\/p>\n<p>You can chose the option \u201cAll URLs\u201d so that \u201cList all URLs\u201d can place the URLs of all the content, webpages and custom post types.<\/p>\n<p>Once you click the \u201cSubmit\u201d button, this plugin will process all the URLs and will display them accordingly.<\/p>\n<p>That\u2019s all to do and it is so easy to list all the URLs in a WordPress website.<\/p>\n<p>You may also like to know how to\u00a0<a href=\"https:\/\/cpanelplesk.com\/wp62\/download-entirewordpress-media-library\/\"><span class=\"Apple-converted-space\"> download media library<\/span><\/a> in WordPress. So, do check it out.<\/p>\n<p>Give your opinion below if you experience any issues or to discuss your ideas and experiences.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For some reasons you might need to get a list of WordPress post URLs to work with. But WordPress doesn\u2019t have any local function to record all the publish, web page and customized post URLs. [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":3587,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,13],"tags":[],"class_list":["post-3586","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","category-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Get a List of All WordPress Post URLs - cPanel Plesk<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Get a List of All WordPress Post URLs - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"For some reasons you might need to get a list of WordPress post URLs to work with. But WordPress doesn\u2019t have any local function to record all the publish, web page and customized post URLs. [...]Continue Reading...\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Seemab Saleem\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/\"},\"author\":{\"name\":\"Seemab Saleem\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\"},\"headline\":\"How to Get a List of All WordPress Post URLs\",\"datePublished\":\"2016-03-16T08:13:28+00:00\",\"dateModified\":\"2021-02-06T06:09:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/\"},\"wordCount\":381,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png\",\"articleSection\":[\"Cpanel\",\"WordPress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/\",\"name\":\"How to Get a List of All WordPress Post URLs - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png\",\"datePublished\":\"2016-03-16T08:13:28+00:00\",\"dateModified\":\"2021-02-06T06:09:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#primaryimage\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png\",\"width\":200,\"height\":200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Get a List of All WordPress Post URLs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\",\"name\":\"Seemab Saleem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"caption\":\"Seemab Saleem\"},\"description\":\"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!\",\"sameAs\":[\"https:\/\/cpanelplesk.com\/wp62\"],\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Get a List of All WordPress Post URLs - cPanel Plesk","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/","twitter_card":"summary_large_image","twitter_title":"How to Get a List of All WordPress Post URLs - cPanel Plesk","twitter_description":"For some reasons you might need to get a list of WordPress post URLs to work with. But WordPress doesn\u2019t have any local function to record all the publish, web page and customized post URLs. [...]Continue Reading...","twitter_image":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png","twitter_misc":{"Written by":"Seemab Saleem","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/"},"author":{"name":"Seemab Saleem","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648"},"headline":"How to Get a List of All WordPress Post URLs","datePublished":"2016-03-16T08:13:28+00:00","dateModified":"2021-02-06T06:09:29+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/"},"wordCount":381,"commentCount":0,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png","articleSection":["Cpanel","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/","url":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/","name":"How to Get a List of All WordPress Post URLs - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#primaryimage"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png","datePublished":"2016-03-16T08:13:28+00:00","dateModified":"2021-02-06T06:09:29+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#primaryimage","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/03\/wordpress.png","width":200,"height":200},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/get-list-wordpress-post-urls\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"How to Get a List of All WordPress Post URLs"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648","name":"Seemab Saleem","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","caption":"Seemab Saleem"},"description":"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!","sameAs":["https:\/\/cpanelplesk.com\/wp62"],"url":"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=3586"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3586\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media\/3587"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=3586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=3586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=3586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}