Skip to content

How to delete CMS Page and Block by Id programmatically in Magento 2?

Today, we will guide you on How to delete CMS Page and Block by Id programmatically in Magento 2. You can delete CMS Page and Block by id in Magento 2 using Repository interface.

Delete CMS Block

Delete CMS Page

Note: You just have to pass CMS page or block id in function to delete specific CMS Page or Block.

deleteCmsBlock(11);
deleteCmsPage(10)

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Share via
Copy link
Powered by Social Snap