Magento 2 – delete categories programmatically

You may also like...

5 Responses

  1. Jeremy says:

    I see this is how to set up the function. But how do I execute it?

    • magemaster says:

      you can for example create a new PHP script file in you Magento 2 root dir like this and add delete categories code at the end and then run this file from command line or from browser.

  2. Roberto says:

    I know its a different question, but I think is related. How can I programmatically change the value of ‘parent_id’ in Magento 2?

    • magemaster says:

      Hi, I did it with this code

  3. Mahi says:

    Is there a way to get store_id of category and after that delete?

Leave a Reply