0

I used Feeds, and for some reason it imported several nodes multiple times; now I have many duplicates.

How could I easily find and delete such nodes?

1
  • I have the same problem, why feed import multiple?
    – Yuseferi
    May 27, 2014 at 5:55

3 Answers 3

2

This Drupal 6 script should do the job for you.

0

You can use a SQL request:

SELECT nid, title, type 
FROM node 
WHERE title IN (
    SELECT title FROM node
    GROUP BY title HAVING count(*) > 1)
ORDER BY title, created DESC;
0
0

You can try this.

    $nids = db_query("SELECT nid FROM node 
    WHERE  type=:type 
    GROUP BY title HAVING count(*) > 1", 
    array(':type'=>'node_type'))->fetchAllKeyed(0,0);

   //Now delete all the duplicate nodes.
    node_delete_multiple($nids);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.