I have several thousand nodes of a particular content type. Using the web interface (example.com/admin/content), I can only delete about 50 at a time. How can I quickly delete them?
|
feedback
|
|
There is a module for that (TM). See Bulk Delete. That will use the Batch API to delete the nodes to avoid timeout or memory issues when deleting thousands of nodes with a single call to node_delete_multiple(). Bulk Delete is an abandoned module. See for alternatives: | |||||||||
feedback
|
|
Looking at the Devel Generate module for inspiration, here is it's "content kill" function:
So I would try either using Devel Generate to delete all nodes but create no new ones, or use example.com/devel/php to call | ||||
|
feedback
|
|
Create a file with below code in root of drupal installation and execute the file.
| ||||
|
feedback
|
|
Views Bulk operations provides a BatchAPI enabled, configurable node admin screen that allows filtering by type, selection of all nodes matching your search criteria, etc. That's my hands-down solution in Drupal 6 - besides batch delete, you can bulk-edit nodes and do a bunch of other stuff. It looks like the Drupal 7 version isn't ready yet - but I'd be watching that module for a D7 release. | |||
|
feedback
|
|
If you want to do it purely through the UI, you can use the devel_generate module.
This way, no nodes will be generated and all nodes of the selected types will be deleted. | |||
|
feedback
|
|
I ended up using db_delete, no modules required:
Edit/Warning: See Berdir's comment below. This method does not clean up all data related to the nodes. | |||||||||||
feedback
|
|
Another snippet is:
where | |||||
feedback
|