How to manually delete a node from the database knowing its id Well, look my problem is weird, I have a view that lists content of a desired type, it is listing all the content of a type, I have deleted from the drupal admin UI a node of that type, but the view is still listing the node I have deleted. If I try to access to that node from the view, I get an entityMetadataWrapperException

Now I cannot see the node in the drupal content admin UI.

I know the nid of this node (its 22) I need to delete it manually from the database, how to achieve this, is necesary a custom module or something?

Thank you very much for your help.
You should use node_delete:

&lt;?php
$nid='22'; // $node id , which you want to delete;
node_delete($nid);
?&gt;


This function from the API does the necessary cleaning up when a node is deleted.

You can stick this in a custom module, or enable the PHP filter and just have it a node where you allow PHP code.

If you use the PHP Filter method, remember to disable it when done.  You don't want it permanently enabled on a production site.

You may also want to repair your database, just to make sure.  The screenshot below shows how to use phpMyAdmin to repair the {sessions} table.  You can also use to repair the {node} table