You can only delete Pens that you own. There are three ways you can delete a Pen:
- You can delete it from your Dashboard
- You can delete it from any other Grid View
- You can delete it from the Pen Editor itself.
Deleting a Pen immediately deletes its hearts, views, comments, and tags, which can never be recovered.
A copy of a deleted Pen is saved to your account’s Dashboard for three days after deletion. You can restore the copy to your account within 3 days of deletion. This will only restore the code, not the hearts, views, and comments or original URL.
From Your Dashboard (or any Grid, like your Profile)
You can delete Pens from your Dashboard. Open the context menu (three dots) and you’ll see a Delete option (assuming you own the Pen, which you will for sure in the Dashboard).
From the Pen Editor View
You can also delete a Pen from the Editor View. Click the “Delete” button at the bottom of the editor window to delete your Pen.
Views, hearts, comments, and tags are immediately deleted when a Pen is deleted. These Pen details cannot be recovered even if the Pen is restored.
Before your Pen is deleted, you’re asked to confirm that you want to delete the Pen. If you are certain you want to delete the Pen, click the button that says “I understand, delete my Pen”.
Restoring a Deleted Pen
Copies of deleted Pens are saved to the “Deleted” section of your Dashboard for three days after deletion. If you accidentally deleted a Pen, you can restore it by clicking the “Restore” button next to the Pen’s title in the “Deleted” section of your Dashboard.
The restored copy includes all of the code, resources, preprocessors, and Pen settings from the last saved version of the Pen. The view count, hearts, comments, and tags are not restored.
Deleted items are permanently deleted 3 days after you delete them from your Dashboard or profile. It is not possible to restore a permanently deleted item.
Permanently Delete a Pen from Your Deleted Items
Deleted items are permanently removed from your account three days after you delete them. But, it is possible to permanently delete them earlier.
If you are absolutely certain that you want to delete a Pen that is in your Deleted Items, click the “Delete Permanently” button next to the Pen’s title in your Dashboard’s “Deleted” tab. This will immediately and permanently delete the Pen. It is not possible to recover a Pen that has been permanently deleted, so do not take this action unless you are certain that you do not want the Pen in your account.