If there are multiple categories that need to be deleted in the operations portal, you can delete them by running a special import in the operations portal. Since deleting categories can affect a lot of data, the best practice is to run the deletion imports after business hours. To start, navigate to the "PIM" section in the Operations Portal.
To start, you will need a list of category codes that you would like to delete. You can use an external spreadsheet that has been saved in .CSV format or an exported list of category codes from the operations portal. If you are using an external spreadsheet, there are two columns that will need to be added in order for the import to run correctly. Click "Categories". In order to access and update “Categories” you will need to be set up either as an “administrator” or a “superuser”, or have the roles of: “categoryView” and “categoryEdit”. along with "importEdit" and "importView". These last two roles are needed for importing.
Select the Data tab.
If you would like to export category data, you will need to choose the columns of data you would like to export by clicking the "Show/Hide" icon.
A column required for deleting categories in the operations portal is the "code" column - the code is required as it is the identifying factor for matching information in the system. The name column can also be helpful when working with category data, but is not needed for this import. Select or deselect the columns that you would like to add or remove.
If you would like to only export specific categories, you can use column filters or the search field to narrow the category selection. In this case, we have filtered on the "insulation" category in the "Parent Category Code" column as we would like to export all insulation sub-categories and delete them.
To export the product categories, click "File".
Choose "Export". For this example, the export will have the "insulation" sub-category codes that are currently in our system.
If you would like, you can rename the export by clicking into the field and type the desired file name.
Click "Save" to save the file to your computer. If you are exporting a large amount of data, it may take a small amount of time to complete the export. The file will download and save to your computer.
You can see in this sample export that we have added two required columns to the exported spreadsheet, and it now has the header row that is needed. If you are using your own spreadsheet, you will need to make sure the columns "isSourceDeleted" and "sourceModifiedTime" have been added. The name column will need to be removed before importing.
The "code" column contains the category codes. When importing category data, the code is required as it is the identifying factor for matching information.
The "isSourceDeleted" column is needed to trigger the deletion, and the value should be "TRUE".
The "sourceModifiedTime" column is also required for mass deleting categories. The value should follow the format indicated below and be close to the current time. The time does not need to be exact: “YYYY-MM-dd hh:mm:ss:SSS. An example of the correct format is 2024-09-10 11:45:00:311. Once you have your export or spreadsheet ready for import, be sure to save as .CSV file which is spreadsheet compatible. Double check that the spreadsheet you are importing only contains the category codes that you would like to delete from the system.
To import the data, click "File".
Select the import option.
In order to delete categories, the "Create & Update" import will need to be selected.
Once you click "Create & Update", you will be prompted to choose and upload a file from your computer. Choose the .CSV file you would like to import. Please be sure that you select the correct file. An import message will appear letting you know that the import file is in process and to check back in a few minutes for the imported data. After the import has completed, you can verify the changes on the commerce site. In this case, we would search on the insulation sub-categories and verify that the categories have been deleted.