Removing email from woocommerce edit account page
<p>I want to remove email field from woocommerce edit account page to prevent user from changing his email address.</p>

<p>it is so easy to remove the front-end part by editing myaccount/form-edit-account.php template. But it's just from the form.</p>

<p>I want to remove if from backend too, so no one can put text box with email name to the form and change the email.</p>

<p>the backend function which does the edit process is here</p>

<p><a href="https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-form-handler.php#L141" rel="nofollow">https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-form-handler.php#L141</a></p>

<p>as you can see, there is no filter or action to exclude email from processing.</p>

<p>any help would be appreciated.</p>

<p><strong>Solution (thanks to @Reigel)</strong></p>

<p>As I said, I had removed the email field from the template file but a malicious user could inject an input field with account_email and change the email. What I wanted was to ignore the POSTED email, if there was any.</p>

<p>so using <code>woocommerce_save_account_details_errors</code> action, it's possible to do it</p>

<p>class example</p>

<pre><code>add_action( 'woocommerce_save_account_details_errors', array( $this, 'remove_email_from_edit_account_process' ), 10,
            2 );


    public function remove_email_from_edit_account_process( $errors, $user ) {
        if ( ! empty( $user-&gt;user_email ) ) {
            unset($user-&gt;user_email);
        }
    }
</code></pre>