You need to create a module that has Setup/InstallData.php
with content similar to
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$installer = $setup;
$installer->startSetup();
$categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
$entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Category::ENTITY);
$attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
$categorySetup->removeAttribute(\Magento\Catalog\Model\Category::ENTITY, 'bottom_description');
$categorySetup->addAttribute(
\Magento\Catalog\Model\Category::ENTITY, 'bottom_description', [
'type' => 'text',
'label' => 'Bottom description',
'input' => 'textarea',
'required' => false,
'sort_order' => 101,
'visible' => true,
'wysiwyg_enabled' => 1,
'visible_on_front' => 1,
'is_html_allowed_on_front' => 1,
'user_defined' => true,
'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
'group' => 'General Information',
]
);
$idg = $categorySetup->getAttributeGroupId($entityTypeId, $attributeSetId, 'General Information');
$categorySetup->addAttributeToGroup(
$entityTypeId,
$attributeSetId,
$idg,
'bottom_description',
46
);
//$installer->updateAttribute($entityTypeId, 'bottom_description', 'is_wysiwyg_enabled', 1);
//$installer->updateAttribute($entityTypeId, 'bottom_description', 'is_html_allowed_on_front', 1);
$installer->endSetup();
}
Read more here.