I am creating a custom module to import export categories in Magento 2. This module will use cron to import categories from a file. I don't want to show this option in Magento import process. This process will only run using cron and cannot be executed manually.

enter image description here

I don't want to show categories option showing in the above image. I tried removing label attribute from import.xml file but got an error

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd">
    <entity name="catalog_category" model="Plenty\Item\Model\Plugin\ImportExport\Import\Entity\Category" 
    behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Basic" />

Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Invalid Document Element 'entity': The attribute 'label' is required but missing.

What should I do show that my entity option is not shown in Magento import section?

1 Answer 1


You can do this by using a simple jQuery string like following:

$j("#ID_HERE option[value='foo']").remove();

By using this, the only risk will be, that it can conflict, so call it something unique.


I understand the fact, that it will still be rendered in the first place, but to block it's rendering would require even more code, so as it's not done for security reason, you might consider a light solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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