Magento 2 – delete categories programmatically

You may also like...

4 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

Leave a Reply

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