---
title: Deleting entries using ldapdelete
description: You can delete an entry using the ldapdelete tool.
component: pingdirectory
version: 11.0
page_id: pingdirectory:pingdirectory_server_administration_guide:pd_ds_delete_entries_ldapdelete
canonical_url: https://docs.pingidentity.com/pingdirectory/11.0/pingdirectory_server_administration_guide/pd_ds_delete_entries_ldapdelete.html
revdate: September 13, 2023
section_ids:
  deleting-an-entry-using-ldapdelete: Deleting an entry using ldapdelete
  steps: Steps
  example: Example:
  deleting-multiple-entries-using-an-ldif-file: Deleting multiple entries using an LDIF file
  about-this-task: About this task
  steps-2: Steps
  example-2: Example:
  example-3: Example:
---

# Deleting entries using ldapdelete

You can delete an entry using the `ldapdelete` tool.

|   |                                                                                                   |
| - | ------------------------------------------------------------------------------------------------- |
|   | Ensure that there are no child entries below the entry because that can create an orphaned entry. |

Back up your system before removing any entries.

## Deleting an entry using ldapdelete

### Steps

1. To delete an entry, run the `ldapdelete` command.

   #### Example:

   The following example deletes the `uid=user.14` entry.

   ```shell
   $ bin/ldapdelete uid=user.14,ou=People,dc=example,dc=com
   ```

## Deleting multiple entries using an LDIF file

### About this task

To generate a file of distinguished names (DNs) to delete from the PingDirectory server:

### Steps

1. To search for all entries in a branch and return the DNs of the subentries, run the following command.

   #### Example:

   For this example, the search is for all entries in the `ou=Accounting` branch.

   ```shell
   $ bin/dump-dns -D "cn=admin,dc=example,dc=com" -w password --baseDN \
                           "ou=Accounting,ou=People,dc=example,dc=com" --outputFile /usr/local/entry_dns.txt
   ```

2. Run the `ldapdelete` command with the file to delete the entries.

   #### Example:

   The following command uses the `--continueOnError` option, which continues deleting through the whole list even if an error is encountered for a DN entry.

   ```shell
   $ bin/ldapdelete --filename /usr/local/entry_dns.txt --continueOnError
   ```
