Deleting users leaves "n/a" ghost nodes that seem impossible to delete without going into the database.

Has this issue been solved?

Maybe it has, but searching on "n/a" within Drupal is impossible.

Comments

budda’s picture

I think the "/" causes Drupal.org search to go potty. It's been reported before.

You could have just blocked users accounts rather than deleting them. But i guess that is no use now :-)

--
www.bargainspy.co.uk

bonobo’s picture

http://drupal.org/node/30253#comment-51850

RE:

but searching on "n/a" within Drupal is impossible

Click

Hope this helps.

Cheers,

bonobo

-------
http://www.funnymonkey.com
Tools for Teachers

PeterLucas’s picture

...but this link doesn't explain how to get rid of the ghost nodes that show up as "n/a" on my website.

Several people in that thread basically advise just not to delete users, because it would be rude or would mess up archived comments.

IMHO that's a weird position. There are lots of valid reasons to delete a user and when you do you kind of assume their posts to get deleted with them. Isn't that how most CMS do it? At least you expect that option.

The issue was brought up here last May (Bug or feature?) but there's no follow up.

bonobo’s picture

the Drupal front end.

This leaves deleting the nodes/comments via the database.

So, first, delete the users.

Then, query the node table against the user table to get a list of all nodes that aren't tied to a valid uid.

Then, make sure you actually want to delete all of those entries. For any entries you want to keep, set the uid on the node table to a valid uid, and delete the rest.

The query should look something like this:

SELECT node.* FROM node
LEFT JOIN users ON node.uid=users.uid
WHERE users.uid IS NULL;

Please post back if this solves it.

Cheers,

bonobo

-------
http://www.funnymonkey.com
Tools for Teachers

PeterLucas’s picture

I already knew I could solve this in the database and will do that when I have the time. I don't expect problems with that, but it shouldn't be necessary.

I started this thread to bring the issue to the attention of developers again. I'm not the only one who had this problem. Others have posted about it, but as far as I can tell it's still an unresolved issue.

Is mass deleting posts possible in Drupal? That's a related issue I think. It makes maintaining a community site a lot harder if you have to do all these things manually in the database.

bonobo’s picture

go to admin--content

You can see all the posts made on the site, filter according to a few criteria, and perform a series of operations (promote, unpublish, delete, etc) on groups of posts.

Cheers,

bonobo

-------
http://www.funnymonkey.com
Tools for Teahers

jmcdaid’s picture

Ghost nodes were showing up on my site and in feeds -- thanks for this thread, which helped solve; knew I could kill orphan (ex-user) nodes through mySQL, but wanted to be sure that wasn't going to create any further problems. (Inability to search on drupal for "n/a" as a string is definitely an issue; I only hit upon searching for "ghost" nodes by trial and error.)

steo83’s picture

Ok but this sql command works for drupal 4 5 or 6? or all of them? Cause in my case (5.7) doesn't work...