Evening everyone. I tried to look around the web to find a solution to this but couldn’t really find anything related. I just need to write a snippet that prevent users to change their display name by hiding the field in the "my account" page or any other smarter way possible. Thank you
2
Answers
Thanks for your question. You can insert this code into your theme functions.php or use Code Snippets plugin. Hopefully, it will work.
From your question I can assume that you are using WooCommerce. You need to make a couple of things done to achieve it:
Firstly, duplicate form-edit-account.php file
to your child theme folder
Then open copied file and remove html markup and php code related to account_display_name field:
Place following php code into your child’s theme functions.php file: