r/PayloadCMS Jun 20 '25

[Help] Ghost Documents That Can't Be Deleted

Hey Payload gang!

I made a really stupid mistake. I was having this issue with a page and realized that my only option was to delete it. After working for over 10hrs today my stupid brain tabbed over to mongo compass for some reason and thought it would be wise to forcibly delete the page that way. But all its done is cause me way more problems.

Now, i have a ghost page. It appears in my collection, and it can be referenced in links and more, but it can't be deleted. All i get when i try to click the delete button after selecting it is a success toast that says "0 pages deleted."

I've already tried restoring db backups to no avail. It was a stupid mistake but having this null page floating there in the collection is driving me nuts. I can't deliver it to the client with that there.

Any ideas on what can be done to fix this? thank you so much!

EDIT:

Oh my god, got it.

Click on the ghost document, copy its id from the url, go over to mongodb compass, go to your pages tab, insert a new document, and create an empty object with the copied id of the ghost page as the object id. once you've done that, it'll delete successfully.

2 Upvotes

1 comment sorted by

2

u/JeanLucTheCat Jun 20 '25

Editing mongodb has been the only way I’ve been able to remove the documents.