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

You can delete CMS Page by Page id in Magento 2 using PageRepositoryInterface interface.

Magento\Cms\Api\PageRepositoryInterface interface is responsible for delete a CMS page from admin panel.

You just need to inject interface in your constructor to delete CMS page. Continue reading “How to delete CMS Page by Id programmatically in Magento 2?”

List of Reserved Keywords in Magento 2.

Magento 2 has a lot of reserved keywords and they define all the reserved keywords in their native core file.

You can find out all the keywords at vendor/magento/framework/App/Router/ActionList.php file.

Reserved keywords are not used to define any class name, function name or variable name in your code. Continue reading “List of Reserved Keywords in Magento 2.”

How to delete CMS Static Block programmatically in Magento 2?

You can delete CMS static block programmatically using deleteById() function of Magento\Cms\Api\BlockRepositoryInterface interface.

You just need to inject the interface in your constructor and you required only a Static Block id to delete a specific Block. Continue reading “How to delete CMS Static Block programmatically in Magento 2?”