Newer Version Available

This content describes an older version of this product. View Latest

Deleting Files from an Organization

The package.xml file is a project manifest that lists all the components you want to retrieve or deploy. While you can use package.xml to add components, it’s not sufficient to delete them. To delete files, you must also create a delete manifest called destructiveChanges.xml. The format of the delete manifest is the same as package.xml, except that wildcards are not supported.

If you try to delete components that do not exist in the organization, the rest of the deletions will be attempted.

Note

The following is a sample destructiveChanges.xml file that names a single custom object to be deleted:

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>MyCustomObject__c</members>
5        <name>CustomObject</name>
6    </types>
7</Package>

In order to deploy the destructive changes, you must also have a package.xml file that lists no components to deploy, includes the API version, and is in the same directory as destructiveChanges.xml:

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <version>31.0</version>
4</Package>