Enable wysiwyg editor for custom category attribute

Enable wysiwyg editor for custom category attribute

August 16, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Enable wysiwyg editor for custom category attribute

Enabling WYSIWYG Editor for Custom Category Attribute in Magento

As a seasoned developer, I often encounter situations where custom attributes don’t behave as expected. One common issue is failing to enable the WYSIWYG editor for text-based fields.

In your case, you’re correctly attempting to enable the WYSIWYG editor by setting 'wysiwyg_enabled' => true in your attribute installation code. However, this approach doesn’t always work out-of-the-box due to Magento’s configuration structure.

The key lies in understanding how Magento manages WYSIWYG enabled attributes. By default, Magento only allows the WYSIWYG editor for certain built-in fields like ‘description’ and ‘short_description’. To enable it for custom fields, you need to explicitly configure it in your theme’s layout XML files.

Here’s a step-by-step guide to resolve this issue:

  1. Check Your Theme’s config.xml

Open the app/design/frontend/{your_package}/{theme_name}/etc/config.xml file and look for any existing WYSIWYG configurations. Make sure that 'html_area_wysiwyg_editor' is enabled.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cms:etc/config.xsd">
    <default>
        <cms_html_area_wysiwyg_editor>1</cms_html_area_wysiwyg_editor>
    </default>
</config>

If the above configuration is missing or disabled, make sure to enable it.

  1. Configure WYSIWYG for Your Custom Attribute

Create a new layout XML file, e.g., app/design/frontend/{your_package}/{theme_name}/layout/catalog_category_edit.xml, and add the following code:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/layout.xsd">
    <update handle="catalog_category_form"/>
    <reference name="category_form_attributes">
        <action method="addAttribute">
            <attribute code="shortdescription"></attribute>
            <type>textarea</type>
            <sort_order>40</sort_order>
            <label translate="true">Short Description</label>
            <depends>category_form</depends>
            <wyg_editor>1</wyg_editor>
        </action>
    </reference>
</config>

In this example, replace 'shortdescription' with the exact name of your custom attribute.

  1. Clear Magento Cache

After making these changes, clear all cache types in Magento to ensure the new configurations take effect.

If you still face issues, double-check that:

  • Your theme is enabled and not overridden by any other themes.
  • The file paths are correct based on your theme’s structure.
  • There are no typos or syntax errors in your XML files.

Remember, enabling WYSIWYG for custom attributes requires careful configuration of both the attribute itself and the layout XML files. Always ensure that you’re working with the latest Magento versions to take advantage of the platform’s built-in editor support.

For more advanced customizations like this, I highly recommend checking out our in-depth tutorials on customizing Magento at Laravel Company. We provide detailed guides and best practices for developers looking to extend Magento’s core functionality.

Happy coding! Let me know if you have any other questions about custom attribute configurations or Magento development.

Catalog Extensions Themes Configuration

Our network