Apex triggers in Salesforce contain automated business logic that fires on DML (Data Manipulation Language) operations such as insert, update, delete, and undelete. Once deployed to a production org, triggers cannot be directly edited or toggled through the Salesforce Setup UI — they must be deployed via metadata tooling.
In certain circumstances, such as during a large data migration or an emergency fix, there may be a need to temporarily or permanently disable an Apex trigger in production. This article explains the supported methods to disable a Salesforce trigger in a production org.
Example scenario: An Apex trigger on the Opportunity object is causing failures during a large data migration. To allow the migration to complete, a system administrator needs to temporarily disable the trigger, run the migration, then re-enable it.
Note: Consider the consequences of disabling a trigger in the production environment during work hours. It is highly recommended to perform this during off-hours. Also, disable access to the application to non-administrators during the maintenance period.
package.xml file to retrieve the metadata of the triggersf org login websf project retrieve start command to retrieve the trigger metadata using the package.xml file created earliertriggername.trigger-meta.xml file and change the status from Active to Inactivesf project deploy start command to deploy the changes to the target org
To see this information in video format, watch
How to Disable a Trigger in a Production Org via Change Set.
triggername.trigger-meta.xml file, change the status from Active to Inactive
Note: The Salesforce Ant Migration Tool is retired in the Spring of 2024. T
Important: The Salesforce Ant Migration Tool was retired in Spring 2024 and is no longer supported or updated with new functionality. The steps above may still function for existing API versions but Salesforce recommends switching to Salesforce CLI for all metadata deployments. For more information, see Salesforce Ant Migration Tool End of Life.
000385540

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.