On this page
zsh terminal, macOS

macOS Keychain Access quirk why you can’t delete items from the UI

Learn why you can't delete items from macOS Keychain UI and how to fix it.

You have an entry in your keychain that you want to delete. When you right-click on the item and select Delete… from the context menu, the item remains in the keychain and is not removed.

Why can’t you delete a keychain item even after selecting Delete… from the context menu?

macOS Keychain Access with "github" text in the search field.

Workaround for deleting keychain items

When using the Keychain Access application, you may encounter a bug that prevents deleting items after searching for them. To work around this issue, try finding the item in the list without using the search function, and then delete it.

How can I remove an item from Keychain Access using the command line?

You can remove an item from the Keychain Access using the command line by using the security command. The basic steps are:

  • Open terminal: you can find Terminal in your Applications folder under Utilities or by searching for it using Spotlight.
  • Identify the item: before deleting an item, you may want to find it first. Use the following command to locate the specific item you want to delete. Replace item_label with the label of the item you are looking for (e.g., the name of a password or service):

    security find-generic-password -l "item_label"

    This command will display the details of the item, confirming its existence in the keychain.

  • Delete the item: once you have confirmed the item you want to delete, use the following command to remove it. Replace item_label with the actual label of the item:

    security delete-generic-password -l "item_label"

    If you are deleting an internet password, you can use:

    security delete-internet-password -l "item_label"
  • Verify deletion: to ensure that the item has been successfully removed, you can run the find command again:

    security find-generic-password -l "item_label"

    If the item has been deleted, this command should return an error indicating that the item could not be found.

  • Deleting an entire keychain: if you want to delete an entire keychain, you can use the command:

    security delete-keychain "keychain_name.keychain"
Be cautious when deleting items or keychains, as this action is irreversible unless you have backups.

Post tags

Related posts

Comments

Leave a Reply

Search in sitelint.com

Elevate your website’s accessibility with SiteLint

Your reliable source for inclusive online experiences. Our cutting-edge tools and services enable businesses to create user-friendly web environments. Join the digital inclusivity movement to discover new ways to engage and grow. Discover the SiteLint platform today and transform your online presence into a beacon of accessibility.

Real-user monitoring for Accessibility, Performance, Security, SEO & Errors (SiteLint)