Is there a "safe" way to delete all the existing content/pages/nodes from a Drupal 7 site, and delete corresponding menu entries? When I deleted the nodes using the admin UI, my menu entries didn't get deleted? What can cause this?

snapshot 1

snapshot 2

  • are you facing any issue if you delete it directly form the drupal admin? – Mohammed Shameem Jan 28 '13 at 4:16
  • Yes, the content from all the other menus is gone, but in the Administration it is still showing up (only when I go to structure/menus/list links though). What is the best practice when it comes to bulk deleting the existing nodes/content? – user12804 Jan 28 '13 at 4:21
  • possible duplicate of Delete all nodes of a given content type – Patrick Kenny Jan 28 '13 at 4:40
  • Thanks for that. I only had about 20 nodes all up, so deleting them via the interface wasn't an issue... – user12804 Jan 28 '13 at 5:06
  • @user12804, then, your question should be updated what is your actual problem is. As your question was to delete all nodes, my answer below is the direct answer to it. – Sithu Jan 28 '13 at 5:19

These Q/A may be helpful for you:
Delete all nodes of a given content type
How to bulk delete content of a given type?
According to the first Q/A, the Delete all module is worth to try.

You could also try mass delete node. The function node_delete() is safe to call. It has a call to node_delete_multiple() which deletes all related components of a node, such as entities, files, revisions, history, etc.

If you already deleted your nodes, but node-related menus are still there, you could also try out menu_rebuild() to rebuild your navigation menus. Check this answer. You could also add menu_rebuild() at the end of the script of mass delete node I mentioned above.


If you know menu IDs, you can remove each of them using menu_link_delete().

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.