How to Delete Catalog Price Rule by rule id Magento 2?

You can delete catalog rule by rule id in Magento 2 using delete by id method of catalog rule repository interface.

You can see a list of available Catalog Price rules from the admin panel by Marketing -> Promotions -> Catalog Price rule.

You need to select id from the list of available catalog price rules grid and pass rule id to the given method from the code snippet. Using the below code snippet you can delete Catalog rule Price programmatically with Magento standard way.

In the above method, You can easily delete any catalog price rule by catalog rule id. You need to use CatalogRuleRepositoryInterface to delete a specific rule.

Output:
If You have passed valid rule id, Rule will be deleted from the Catalog rule price Grid. If the rule id is not found, the result will be False.