Whenever you are developing a WordPress website or when you want to redirect a bunch of URLs at the same time or for whatever reason, you may need to get a list of URLs to work with.
But WordPress doesn’t have any native feature to list all the post, page and custom post type URLs.
Sure, you can copy individual URLs, but that approach is time-consuming and is also terribly inconvenient. So, if you ever need, here is how you can list all the WordPress post URLs using a simple code block and a plugin from the official WordPress repository.
Get a List of URLs Using a Plugin
The other way around is to use a simple plugin called List all URLs which is available in the official WordPress repository.
1.You can install it like any other WordPress plugin and once installed, open “List all URLs” settings page located under the “Settings” category.
2.Now select the radio button according to your requirements and also select the check box “Make the generated list of URLs clickable hyperlinks” if you want clickable links.
3.As you can see, I’ve selected the option “All URLs” so that “List all URLs” will list the URLs of all the posts, pages and custom post types.
4.Once you click the “Submit” button, the plugin will process all the URLs and will display them accordingly.
Get a List of URLs Manually Without Installing a Plugin
1.To manually get a list of all the URLs in your WordPress site, create a new file with the name export.php and open it.
2.Once opened, copy and paste the below code into that file and save it.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?php
include "wp-load.php";
$posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish');
$posts = $posts->posts;
header('Content-type:text/plain');
foreach($posts as $post) {
switch ($post->post_type) {
case 'revision':
case 'nav_menu_item':
break;
case 'page':
$permalink = get_page_link($post->ID);
break;
case 'post':
$permalink = get_permalink($post->ID);
break;
case 'attachment':
$permalink = get_attachment_link($post->ID);
break;
default:
$permalink = get_post_permalink($post->ID);
break;
}
echo "\n{$permalink}";
//echo "\n{$post->post_type}\t{$permalink}\t{$post->post_title}";
}
?>
|
3.Now login to your site’s FTP account using FileZilla or any other equivalent FTP software. Once logged in, upload the newly created file into your site’s root directory.
4.Once the file is uploaded, fire up your browser and enter the URL –
http://yourdomain.com/export.php
in the address bar.
5.Now the uploaded file will be executed and you will get a list of all the post URLs in your WordPress site.
By default, the above code is set in a way that it only displays the post URLs and ignores other things like “post type” and “post title.” If you want them, just comment out the
line 27
and uncomment the line 28
and you are good to go.
That’s all there is to do and it is that simple to list all the URLs in a WordPress site.
Hopefully that helps and do comment below if you face any problems or to share your thoughts and experiences.
How To Get A List Of All Wordpress Post Urls - Just Duplicate >>>>> Download Now
BalasHapus>>>>> Download Full
How To Get A List Of All Wordpress Post Urls - Just Duplicate >>>>> Download LINK
>>>>> Download Now
How To Get A List Of All Wordpress Post Urls - Just Duplicate >>>>> Download Full
>>>>> Download LINK F9