1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Blogging' started by Axelz, Sep 29, 2010.

  1. Axelz

    Axelz Registered Member

    Joined:
    Feb 19, 2009
    Messages:
    67
    Likes Received:
    31
    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.
     
    • Thanks Thanks x 9
  2. bhatsuccess

    bhatsuccess Junior Member

    Joined:
    Mar 26, 2009
    Messages:
    193
    Likes Received:
    103
    Home Page:
    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?
     
  3. seorp

    seorp Registered Member

    Joined:
    Jul 13, 2010
    Messages:
    78
    Likes Received:
    4
    change your hosting :p
     
  4. Axelz

    Axelz Registered Member

    Joined:
    Feb 19, 2009
    Messages:
    67
    Likes Received:
    31
    From WP support forum:

     
  5. bhatsuccess

    bhatsuccess Junior Member

    Joined:
    Mar 26, 2009
    Messages:
    193
    Likes Received:
    103
    Home Page:
    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
     
  6. dikoro

    dikoro Regular Member

    Joined:
    Dec 16, 2008
    Messages:
    205
    Likes Received:
    39
    It works great! Thanks so much. I was looking for way to scrape my own blog post for mass commenting.
     
  7. CyberSEO

    CyberSEO Senior Member

    Joined:
    Jul 14, 2011
    Messages:
    939
    Likes Received:
    255
    Occupation:
    programmer
    Home Page:
    What for? oO
     
  8. dikoro

    dikoro Regular Member

    Joined:
    Dec 16, 2008
    Messages:
    205
    Likes Received:
    39
    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.
     
    • Thanks Thanks x 1
    Last edited: Sep 3, 2011
  9. Scripteen

    Scripteen Elite Member

    Joined:
    Sep 19, 2009
    Messages:
    1,811
    Likes Received:
    1,918
    Home Page:
    The perfect answer. Sure getting list of your wp posts can be used in different ways for SEO.
     
  10. Axelz

    Axelz Registered Member

    Joined:
    Feb 19, 2009
    Messages:
    67
    Likes Received:
    31
    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/
     
    • Thanks Thanks x 1
  11. orimom

    orimom Newbie

    Joined:
    Aug 15, 2011
    Messages:
    7
    Likes Received:
    0
    it work's great.
    thanks...
     
  12. subster

    subster Elite Member

    Joined:
    Apr 5, 2008
    Messages:
    1,864
    Likes Received:
    1,448
    Location:
    Krauthausen
    This is so useful! Thank you very much. It's a shame that there are just a few thanks...
     
  13. webnise

    webnise Regular Member

    Joined:
    Dec 21, 2009
    Messages:
    296
    Likes Received:
    121
    Location:
    London
  14. shamik

    shamik Newbie

    Joined:
    May 9, 2010
    Messages:
    35
    Likes Received:
    18
    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.
     
  15. uzzy1986

    uzzy1986 Newbie

    Joined:
    Jun 8, 2011
    Messages:
    6
    Likes Received:
    1
    white page :confused:after doing all the steps
     
  16. nersande

    nersande Registered Member

    Joined:
    Jun 9, 2014
    Messages:
    73
    Likes Received:
    8
    Occupation:
    I blog for a living.
    Location:
    Germany
    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