How can I remove the validation from city field which says, "Please use letters only (a-z or A-Z) in this field". I have checked the extension files but I can't find anything there.

2 Answers 2


Find below mentioned file If they are not already exist within your theme copy the following files from the base/default theme to your theme:


In each of these files, look for the <input> that defines the city field and remove the required class from the label, remove the required-attribute class from the input and make sure to remove the *.

  • Hi, it causes another issue with my dashboard. After implementing the above method, I can't see order details in admin. Customer names disappeared. here it is link May 22, 2016 at 14:31
  • I believe that it can't make any issue, Please check your code again and also check errors log file. Or Roll back the changes and see what happened
    – Arunendra
    May 22, 2016 at 16:28

1- Remove the required class from following files in your theme folder.


<!--<label for="shipping:city" class="required"><em>*</em><?php echo $this->__('city') ?></label>-->
<label for="shipping:city"><?php echo $this->__('city') ?></label>

also remove classes from input field as-well

<?php //echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>

2- copy this core class to your local and remove following lines app/code/core/Mage/Customer/Model/Address/Abstract.php

/*if (!Zend_Validate::is($this->getcity(), 'NotEmpty')) {
  $this->addError(Mage::helper('customer')->__('Please enter the city number.'));

3- Change the attribute is_required in DB

update eav_attribute set is_required=0 where attribute_code='city';

Note: step three is a dirty hack, correct way would be creating an setup file in your custom extension.

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.