0

In Magento 2, there is a product attribute code with space.(I know, Magento will not allow to create product_attribute_code with space or with Capital letters).

Now, I need to change/update that product_attribute_code (code alone) to without space.

How to do this.

1 Answer 1

-1

Magento does not allow to change the attribute code once it is created. You need to remove this attribute from attribute set and create the new attribute with same name without space and proceed.

I will not recommend to do this but if you really wants to change the attribute code you can change it from database. The attribute code value saved to eav_attribute table you can search for your attribute and change the code. (This is not recommended).

5
  • Yes, I changed already. But I need it via code Jun 20, 2018 at 10:12
  • @Saravanan DS Can you please explain what exactly you wants to do? From code?
    – techfoodie
    Jun 20, 2018 at 11:46
  • As I mentioned, I need to change/update that product_attribute_code (code alone) to without space. Jun 20, 2018 at 12:30
  • How did you create the product attribute code with space? because Magento does not allow to create such.
    – techfoodie
    Jun 20, 2018 at 12:56
  • try it. If you creating through code means, it doesnot show any errors. It will be created. YOu will get error only manual creation. Jun 20, 2018 at 13:06

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.