---
title: "Magento 2: Create Separate Column for Additional Attribute While Export Product"
url: "https://magecomp.com/blog/magento-2-create-separate-column-for-additional-attribute-while-export-product/"
date: "2024-01-12T17:48:47+00:00"
modified: "2025-02-12T12:08:53+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 394
reading_time: "2 min read"
summary: "Hello Magento Friends,"
description: "In Magento 2, if you want to create a separate column for an additional attribute while exporting products, you can achieve this with the help of the steps m..."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Get Credit Memo Information Using SOAP API in Magento 2"
    url: "https://magecomp.com/blog/get-credit-memo-information-using-soap-api-magento-2/"
  - title: "How to Get Invoice Details by Invoice Id in Magento 2"
    url: "https://magecomp.com/blog/get-invoice-details-by-invoice-id-magento-2/"
  - title: "How to setup a Cron Job in cPanel for Magento?"
    url: "https://magecomp.com/blog/how-to-setup-a-cron-job-in-cpanel-for-magento/"
---

# Magento 2: Create Separate Column for Additional Attribute While Export Product

_Published: January 12, 2024_  
_Author: Dhiren Vasoya_  

![Magento 2: Create Separate Column for Additional Attribute While Export Product](https://magecomp.com/blog/wp-content/uploads/2024/01/Add-a-subheading-1-1-1024x512.webp)

**Hello Magento Friends,**

In today’s blog, we will learn about How to Create a Separate Column for Additional Attributes while exporting Products in Magento 2.
[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-6.webp)](https://magecomp.com/services/hyva-theme-development/)

Magento 2 provides a comprehensive product export functionality, allowing store owners to export product information in CSV format. However, if you have custom attributes that are not included in the default export, you might find it challenging to include them in the exported file. Creating a separate column for these additional attributes can greatly enhance the flexibility of your product data management.
Let’s find out How to Create a Separate Column for Additional Attribute while Exporting Products in Magento 2.
## Steps to Create Separate Column for Additional Attribute While Export Product in Magento 2:
**Step 1:** First, we need to create a **“di.xml“** file inside our extension at the following path
**app\code\Vendor\Extension\etc\di.xml**

Then add the code as follows
```
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="MagentoCatalogImportExportModelExportProduct" type="VendorExtensionModelRewriteCatalogImportExportExportProduct" />
</config>
```

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-1.webp)](https://magecomp.com/services/hire-magento-programmer/)

**Step 2:** After that, we need to create a **“Product.php”** file inside our extension at the following path
**app\code\Vendor\Extension\Model\Rewrite\CatalogImportExport\Export\Product.php**

And add the code as given below
```
<?php
namespace VendorExtensionModelRewriteCatalogImportExportExport;

class Product extends MagentoCatalogImportExportModelExportProduct
{
    protected function setHeaderColumns($customOptionsData, $stockItemRows)
    {
        $attr = "Here Pass Attribute Code Array";
        $merge = explode(',', $attr);

        if (!$this->_headerColumns) {
            $customOptCols = [
                'custom_options',
            ];
            $this->_headerColumns = array_merge(
                [
                    self::COL_SKU,
                    self::COL_STORE,
                    self::COL_ATTR_SET,
                    self::COL_TYPE,
                    self::COL_CATEGORY,
                    self::COL_PRODUCT_WEBSITES,
                ],
                $this->_getExportMainAttrCodes(),
                $merge,
                [self::COL_ADDITIONAL_ATTRIBUTES],
                reset($stockItemRows) ? array_keys(end($stockItemRows)) : [],
                [],
                [
                    'related_skus',
                    'related_position',
                    'crosssell_skus',
                    'crosssell_position',
                    'upsell_skus',
                    'upsell_position'
                ],
                ['additional_images', 'additional_image_labels', 'hide_from_product_page']
            );
            if ($customOptionsData) {
                $this->_headerColumns = array_merge($this->_headerColumns, $customOptCols);
            }
        }
    }
}
```

## Conclusion:
This way you can create a separate column for additional attributes while exporting products in Magento 2. If you have any doubts regarding the above steps, share them with me through the comment section. Share the solution with your friends and stay updated with us for more such Magento 2 tutorials.
[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2-2.webp)](https://magecomp.com/services/magento-upgrade-services/)

[**Hire Experienced Magento Developers**](https://magecomp.com/hire-magento-developer.html) for customization requirements for your store.
**Happy Coding!**


---

_View the original post at: [https://magecomp.com/blog/magento-2-create-separate-column-for-additional-attribute-while-export-product/](https://magecomp.com/blog/magento-2-create-separate-column-for-additional-attribute-while-export-product/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-11-03 21:34:11 UTC_  
