0

This question already has an answer here:

How can I remove a group that I created previously using :

groupName="machin"

root = QgsProject.instance().layerTreeRoot()

group = root.addGroup(groupName)

marked as duplicate by underdark May 21 at 19:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

You can use this

root.removeChildNode(group)

Not the answer you're looking for? Browse other questions tagged or ask your own question.