I have created view which displays a list of nodes. I made a custom module with a function which calls db_query() to delete the specified node in the list. I made a Global:Custom Text field in the view which I made into a link to point to that function. The link works perfectly, the node is deleted from the database table, but now the view still lists a blank line (where that node used to be) which still has the Global:Custom Text field there. How can I get rid of this line completely?

1 Answer 1


Why not use the Views Bulk Operations module? This is a great module for updating and deleting nodes from Views.

  • It definitly does look like a useful module. But since I have already created everything myself except for this last issue, do you have an idea how I could do this myself? Apr 17, 2012 at 18:21
  • use node_delete() or node_delete_multiple() instead of db query , but for my opinion , Views bulk operation would be the best Solution
    – sel_space
    Apr 17, 2012 at 18:37
  • I have been looking for a good tutorial on node_delete() and I can't find one. It takes one parameter, $nid. In the function I mentioned above, how can it know what the $nid is? Is it automatically passed when I click the link in the view? Apr 17, 2012 at 18:59
  • I got it to work. Thanks, that was the exact thing I needed! Apr 17, 2012 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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