Hello,
To accomplish that task we recommend using DOCXPath (https://www.phpdocx.com/documentation/introduction/docxpath).
You can optimize the placeholders and then use DOCXPath to replace (https://www.phpdocx.com/api-documentation/docx-path/replace-elements-in-docx) or remove (https://www.phpdocx.com/api-documentation/docx-path/remove-elements-in-docx) the placeholder and its siblings if needed.
Regards.