I wish to create new fields in the customer registration form. I just wanted to know whether there is any option to create it from Magento admin panel.

Kindly guide me as am new to magento.


No, There is no option to create it from admin. You will need to create custom script to create it. You can follow below module steps to create custom attribute.


<?xml version="1.0"?>


$installer = $this;

$installer->addAttribute("customer", "custom_attribute",  array(
    "type"     => "varchar",
    "backend"  => "",
    "label"    => "Custom Attribute",
    "input"    => "text",
    "source"   => "",
    "visible"  => true,
    "required" => false,
    "default" => "",
    "frontend" => "",
    "unique"     => false,
    "note"       => ""


        $attribute   = Mage::getSingleton("eav/config")->getAttribute("customer", "custom_attribute");


        $attribute->setData("used_in_forms", $used_in_forms)
        ->setData("is_used_for_customer_segment", true)
        ->setData("is_system", 0)
        ->setData("is_user_defined", 1)
        ->setData("is_visible", 1)
        ->setData("sort_order", 100)


And finally declare your module


<?xml version="1.0"?>

You can change your attribute code and label as per your requirement.

  • Thank you so much your reply..! But still the custom attribute is not displayed in the frontend. – Ramya Nov 30 '15 at 10:55
  • it will not display automatically in front-end. you will need to call it in template file manually. – Akhilesh Patel Nov 30 '15 at 11:53
  • Yes I called (<?php $_age = $this->getLayout()->createBlock('customer/widget_age') ?> <?php if ($_age->isEnabled()): ?> <li><?php echo $_age->setAge($this->getCustomer()->getAge())->toHtml() ?></li> <?php endif ?>) in form/edit.phtml and form/register.phtml as I wish to include a field for 'age' – Ramya Dec 1 '15 at 6:57
  • you can call it like <input type="text" name="age" id="age" value="<?php echo $this->escapeHtml($this->getFormData()->getAge()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Age')) ?>" class="input-text required-entry" /> – Akhilesh Patel Dec 1 '15 at 7:26
  • Thank you. but still I didn't get it. Is there anything else that should be done since am using Magento version – Ramya Dec 1 '15 at 7:32

I do not have the rep to comment, so I had to answer.

There is no way from admin panel as such. But you can do that custom

I am assuming it for magento 1. And I think the question is already shared in the post:-


You did not explained is it for Magento 2, or Magento 1

In the same post Sylvain Rayé shared the piece of code along with git from where you can download the code to do so.

Answer he shared:-

To allow to publish an attribute in the register form and some others form page, you have to set that the attribute(s) is/are available to those forms.

To do that here is a sample code to put in your sql setup below. You can find the rest of the code I used for my Magento Username module on my github account.

/* @var $installer Diglin_Username_Model_Entity_Setup */

$installer = $this;

/* @var $eavConfig Mage_Eav_Model_Config */

$eavConfig = Mage::getSingleton('eav/config');

$store = Mage::app()->getStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$attributes = $installer->getAdditionalAttributes();

foreach ($attributes as $attributeCode => $data) {
    $installer->addAttribute('customer', $attributeCode, $data);

$attribute = $eavConfig->getAttribute('customer', $attributeCode);
$attribute->setWebsite( (($store->getWebsite()) ? $store->getWebsite() : 0));

if (false === ($attribute->getIsSystem() == 1 && $attribute->getIsVisible() == 0)) {
    $usedInForms = array(
    if (!empty($data['adminhtml_only'])) {
        $usedInForms = array('adminhtml_customer');
    } else {
        $usedInForms[] = 'adminhtml_customer';
    if (!empty($data['adminhtml_checkout'])) {
        $usedInForms[] = 'adminhtml_checkout';

    $attribute->setData('used_in_forms', $usedInForms);


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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