How to Delete existing duplicate post from WordPress?

I have at least 9000 posts in my word-press and i want to delete only duplicate post which was created before? so i just want to delete those extra posts which was there in my word-pres. I try to find out if i am get any plug-in related to it but i can’t

Is there any plug-in or script there which will help me to do this?

Read More

reply will be appreciated!

thank

Related posts

Leave a Reply

2 comments

  1. you should probably start with restricting revisions

    define('WP_POST_REVISIONS', 10); // paste in wp-config
    

    http://codex.wordpress.org/Editing_wp-config.php#Post_Revisions

    I also advice to just delete all current revisions from the database with the following SQL:

    DELETE a,b,c FROM `wp_posts` a
    LEFT JOIN `wp_term_relationships` b ON (a.ID = b.object_id)
    LEFT JOIN `wp_postmeta` c ON (a.ID = c.post_id)
    WHERE a.post_type = 'revision';
    

    After that make a list of all posts with the same post title:

    SELECT * FROM `wp_posts` ORDER BY `wp_posts`.`post_title` DESC
    

    Look for double post titles, post-types etc, and note there ID’s
    If you have a list of double ID’s. use this SQL to delete them:

    DELETE a,b,c,d,e FROM `wp_posts` a
    LEFT JOIN `wp_term_relationships` b ON (a.ID = b.object_id)
    LEFT JOIN `wp_postmeta` c ON (a.ID = c.post_id)
    LEFT JOIN `wp_comments` d ON (a.ID = d.comment_post_ID)
    LEFT JOIN `wp_commentmeta` e ON (d.ID = e.comment_id)
    WHERE a.ID = FOUND_ID; # 1 ID at once
    

    Do make a backup before you start
    I hope this helps