Title: Readonly not working
Last modified: July 26, 2018

---

# Readonly not working

 *  Resolved [lucasln1](https://wordpress.org/support/users/lucasln1/)
 * (@lucasln1)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/readonly-not-working/)
 * Hi im using this code to make the billing_email field turn into a read only field
 * add_action (‘woocommerce_checkout_fields’,’readonly_billing_email’,10,1);
    function
   readonly_billing_email($checkout_fields){ $checkout_fields[‘billing’][‘billing_email’][‘
   custom_attributes’] = array(‘readonly’ => ‘readonly’); return $checkout_fields;
 * }
 * But its notworkig , do you guys know why ?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/readonly-not-working/#post-10531817)
 * Worked for me. Did you try it with only Storefront and WooCommerce active, to
   be able to rule out interference from something else.
 * Do you have error logging enabled, if so anything in the log.
 * Try changing the 10 to 10000 so your snippet runs after anything else.
 * Ensure you are using straight quotes and not smart quotes.
 *  [Rynald0s](https://wordpress.org/support/users/rynald0s/)
 * (@rynald0s)
 * Automattic Happiness Engineer
 * [7 years, 9 months ago](https://wordpress.org/support/topic/readonly-not-working/#post-10566863)
 * Howdy!
 * We haven’t heard back from you in a while, so I’m going to go ahead and mark 
   this thread as resolved. If you have any other questions please start a new thread.
 * Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Readonly not working’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Rynald0s](https://wordpress.org/support/users/rynald0s/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/readonly-not-working/#post-10566863)
 * Status: resolved