Wordpress plugin to list all posts in wp-admin?

11 replies
  • WEB DESIGN
  • |
A while ago I spotted a cool little plugin that allowed us to list, view and delete all our posts at once in the back end in one big long page. I've been asked to help someone clear thousands of extra posts added by a rogue Facebook extraction plugin. It was being sold as a WSO. Can anyone remember what it was called or who sold it or have a link?
#list #plugin #posts #wordpress #wpadmin
  • Profile picture of the author venfrancis
    I think you don't really need a plugin for this. You just have to create your page template and do a custom query to do the job

    PHP Code:
    // WP_Query arguments
     
    = array (
        
    'post_type'              => 'post',
        
    'order'                  => 'DESC',
        
    'orderby'                => 'date',
    );

    // The Query
     
    = new WP_Query(  );

    // The Loop
    if ( () ) {
        while ( () ) {
            ();
            
    // your typical wordpress template.
        
    }
    } else {
        
    // no posts found
    }

    // Restore original Post Data
    wp_reset_postdata(); 
    Signature

    UI/UX Designer + Frontend Developer from Philippines | ven.revereasia.com

    {{ DiscussionBoard.errors[9512680].message }}
  • Profile picture of the author Mr Bill
    Thanks! I'm off to google to see what "do a custom query" means. Can I define how many pages are displayed? There are thousands of pages to remove so I'd like to limit the display to (say) 100 at a time.
    {{ DiscussionBoard.errors[9512692].message }}
    • Profile picture of the author venfrancis
      what do you mean by "There are thousands of pages to remove" ?


      anyway, ignore the previous code i gave coz WF doesn't show some of the codes, i'd pasted it here list all post per 100 - 3a049ed6

      what it does:

      1. get all the "published" post,
      2. display it 100 per page
      3. in the most recent date published.
      Signature

      UI/UX Designer + Frontend Developer from Philippines | ven.revereasia.com

      {{ DiscussionBoard.errors[9513436].message }}
  • Profile picture of the author Mr Bill
    Thanks Ven! I owe you a favour - bookmark my name.

    Re: 1,000 pages: In my original post you'll see that we're trying to clear thousands of posts made by a rogue Facebook importing plugin. but above I said Pages but I meant posts. Sorry about the confusion.

    So do I just make a PHP page and add your code, upload it to the directory and open it? Were should that page go? Into the root?
    {{ DiscussionBoard.errors[9514538].message }}
  • Profile picture of the author SteveJohnson
    You're going to clear 'thousands of posts' by hand???

    The WP 'Posts' Dashboard page will let you view/edit/delete up to 200 posts per page (see the Screen Options tab at the top right).

    This sounds more like a job for a small plugin script. If there is anything unique about the rogue posts, it would be fairly simple to write, and would save you hours of time.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[9515007].message }}
  • Profile picture of the author Mr Bill
    I'm not, the person I'm helping is and there are actually 120,000 of them! Using your 200 at a time method and figuring it'll take 2 minutes to run through the list and check off the rogues and delete them I figure it'll take about 600 x 2 minutes = 1,200 minutes = 20 hours work. 2 big days of 10 hours each and it'll be cleared and the lesson learned. I've heard of bigger fines but this one's a doozy.

    By the way, I'm not making or asking for any money for this help, they just asked for my help so I figured I'd ask you guys.

    As for your tip to click on view screen options I say NO WAY!...I had no idea that was there! In all my years I've never clicked that area once. I feel like a bit of a dunce now (it happens hourly). Is 200 the maximum?

    As for sorting by unique feature; I don't think there is anything unique about the posts. A plugin apparently went mental and imported a heap of duplicate and rubbish posts from facebook. Yep, there are thousands I'm told but I think 200 at once --> select all --> delete will do the trick plus I'm not sure it'll be a good idea to load more than 200 pages at a time. The browser will probably choke. Thanks Steve! and Thanks Ven!
    {{ DiscussionBoard.errors[9515027].message }}
  • Profile picture of the author venfrancis
    Ok so i'm confused now. Where are you trying to display the list of posts? In the admin page? or in front-end page (the page where the user actually reads all your content)?

    If it's in the frontend page, i'll answer your above question:

    "So do I just make a PHP page and add your code, upload it to the directory and open it? Were should that page go? Into the root?"

    yep create a page template and put it in your template directory(/wp-content/themes/yourtheme/yourfilename.php). Just make sure you'll be naming the template in the top most of the code so that it'll appear on the list of template you can you when you're trying to create/edit the page in the admin. For instance:

    Code:
    <?php
    /**
     * Template Name: My Custom Page to List 10,000 Posts
     * By: Ven Francis
     *
     */
    get_header(); ?>
    
    and the rest of the codes here for the body(together with the code i gave for the custom query) and footer.
    and then...viola.

    On the other hand, if you're trying to overide the number of posts to list in your admin page:

    In WP 2.6 +, you can edit wp-admin/edit-pages.php and from line 126, change the variable $per_page = 20; to reflect the number of pages you'd like to show in each view. -- from wp support forum.
    Signature

    UI/UX Designer + Frontend Developer from Philippines | ven.revereasia.com

    {{ DiscussionBoard.errors[9515394].message }}
  • Profile picture of the author venfrancis
    and yes, i'll totally agree that your browser will choke in doing this. Though you can test it first what number is best. 200 is manageable by modern browser if you're only thinking of them. But think of your server's capacity also, commonly I/O capacity has limitations.
    Signature

    UI/UX Designer + Frontend Developer from Philippines | ven.revereasia.com

    {{ DiscussionBoard.errors[9515406].message }}
  • Profile picture of the author Mr Bill
    Perfect, I think Steve's pointing out how to display up to 200 pages was the tip I needed. Sorry for any misunderstanding. Yes, the user wants to display as many pages as he can in the backend here --> /wp-admin/edit.php?post_type=page

    So the maximum WP will display using Steve's tip is 200? I think that'll be enough because as we all agree, the browser will choke with too many. All the user wants to do is list the pages so they can select and trash them but there are so many that doing with the standard display would take forever. If 200 (or even 100) can display - it'll be a huge help so thanks to you both. I'll be sure to vote for you both at the Warrior Awards.
    {{ DiscussionBoard.errors[9515466].message }}
  • Profile picture of the author KirkMcD
    It would probably be easier to go in through the backend and delete them from the database through SQL.
    There is probably something in the post that will be able to identify it easily.
    {{ DiscussionBoard.errors[9516067].message }}

Trending Topics