This tutorial explains how to mass delete magento 2 categories programmatically. If you want to delete all the categories of magento 2 programmatically use the following script.Please also refer the tutorial which explains how to import magento 2 categories programmatically.
The following tutorial gives the step by step explanation of how to create the file, connect to magento database externally and delete the categories programmatically.
This tutorial explains how to insert update wordpress post programmatically. Here it explains how to read data from the CSV file and bulk import content and create the wordpress posts programmatically.
Suppose you are trying add bulk content and images to the wordpress site sometimes it is not practical to create the post from the wordpress admin area. In that case the external script plays a good role.