How to extract all your Wordpress post URLs [How-to]

Axelz

Registered Member
Joined
Feb 19, 2009
Messages
67
Reaction score
33
Do you need a list of links to all the posts of your Wordpress site?
This will come in handy when you want to do linking to posts within your own network, want to post comments on your own blogs using ScrapeBox on your own blogs linking to your other sites, etc. etc.

Open notepad or any other text editor and paste the following code inside:

Code:
<?php

require_once('../wp-blog-header.php');
query_posts('&showposts=-1&order=ASC');

while (have_posts()) : the_post(); ?>

<?php the_permalink(); ?>|<?php the_title(); ?>|<?php the_tags(); ?>
<br />

<?php endwhile; ?>
Save the file with any name you want, we'll use postlinks.php in this example, but make sure it has the .php extension. Upload this file to your /wp-content/ folder.

Now in your favorite browser bring up http://www.yoursite.com/wp-content/postlinks.php

This will return your links in this format:

http://www.yoursite.com/link-to-post | Name of your post | Tags

If you only need the link take out the code for the_title and the_tags as well as the delimiter.

Now you can use this list for whatever you want.
 

bhatsuccess

Junior Member
Joined
Mar 26, 2009
Messages
194
Reaction score
103
This is monster if I can get it to work. I'm getting the following error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /home/gator11/public_html/NAMEOFWEBSITE.COM/wp-includes/meta.php on line 197

Any clues?
 

Axelz

Registered Member
Joined
Feb 19, 2009
Messages
67
Reaction score
33
This is monster if I can get it to work. I'm getting the following error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /home/gator11/public_html/NAMEOFWEBSITE.COM/wp-includes/meta.php on line 197

Any clues?
From WP support forum:

1. Try adding this line to your wp-config.php file:
define('WP_MEMORY_LIMIT', '64M');

2. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

3. If you don't have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M

4. Talk to your host.
 

bhatsuccess

Junior Member
Joined
Mar 26, 2009
Messages
194
Reaction score
103
The Hostgator hosting I have is actually superb. I have hosting accounts at other hosts also and they are terrible for autoblogs.

Ok let me try to work with this...thanks
 

dikoro

Regular Member
Joined
Dec 16, 2008
Messages
205
Reaction score
39
It works great! Thanks so much. I was looking for way to scrape my own blog post for mass commenting.
 

dikoro

Regular Member
Joined
Dec 16, 2008
Messages
205
Reaction score
39
What for? oO

1. For link building every post.
2. For mass commenting your every single post using scrapebox.
3. To re-check your url with your tags without buying or using the Web Auditor. You will see clearly how ugly they are if you have NOT done the friendly url properly.

That's all i can think of.
 
Last edited:

Scripteen

Elite Member
Joined
Sep 19, 2009
Messages
1,810
Reaction score
1,921
Website
www.lindexed.com
1. For link building every post.
2. For mass commenting your every single post using scrapebox.
3. To re-check your url with your tags without buying or using the Web Auditor. You will see clearly how ugly they are if you have NOT done the friendly url properly.

That's all i can think of.

The perfect answer. Sure getting list of your wp posts can be used in different ways for SEO.
 

Axelz

Registered Member
Joined
Feb 19, 2009
Messages
67
Reaction score
33
For #2, make sure you're disabling the comment flood in your WordPress blog, here's a plugin I have used in the past when mass commenting my own blogs - wordpress.org/extend/plugins/disable-check-comment-flood/
 

subster

Elite Member
Joined
Apr 5, 2008
Messages
2,157
Reaction score
1,607
This is so useful! Thank you very much. It's a shame that there are just a few thanks...
 

shamik

Newbie
Joined
May 9, 2010
Messages
35
Reaction score
20
If you have cpanel just go into phpmyadmin and export the comments table as a csv file then open it in a spreadsheet and copy the urls.
 

nersande

Registered Member
Joined
Jun 9, 2014
Messages
76
Reaction score
8
You can also use the normal export from wordpress, minimal magic with a text editor and get your list. if you want to have it updated regulary and have additional information, I suggest you set up an ifttt recipe so that new postings get added to a google spreadsheet and have the required information in separate columns
 
Top