WooCommerce, Remote Work & Other Fancy Stuff

Just another WordPress site

Prevent WooCommerce From Changing WordPress User Display Name

April 26, 2017 by Will Leave a Comment

WooCommerce, by default, will change the WordPress display name for any given user to their First Name Last Name when that user makes a purchase through WooCommerce. This probably makes a lot of sense in the interest of customer relationships, but there may be cases where this is undesirable, say in the case of a forum on your site that uses the display name. Perhaps users would rather maintain a bit of anonymity on your forums. Not to worry, however, WooCommerce provides a filter that can be used to prevent this behavior. The filter is named woocommerce_update_customer_args and here is a quick example of how that can be implemented to set the display name to the username:

Not sure what to do with code snippets? See What Do I Do With These Code Snippets?

Filed Under: WooCommerce Tagged With: snippet, snippets

Leave a Reply Cancel reply

You must be registered and logged in to post a comment.

© 2023 · WooCommerce, Remote Work & Other Fancy Stuff · Epstein didn't kill himself