Website Building » WooCommerce » How Do I Show My Customer Username in WooCommerce?

How Do I Show My Customer Username in WooCommerce?

Last updated on January 18, 2023 @ 8:23 am

If you’re running a WooCommerce store, it’s important that you provide your customers with their usernames so they can log in and access their account information. There are a few different ways you can do this.

PRO TIP: If you are using WooCommerce to manage your online store, it is important to be aware of the potential risks associated with displaying customer usernames on your website. By doing so, you are potentially giving away sensitive information that could be used to exploit your customers. In addition, hackers could use this information to gain access to customer accounts and wreak havoc on your site. As such, it is strongly advised that you do not display customer usernames on your WooCommerce-powered website.

One way is to add a username field to the My Account page. To do this, go to WooCommerce > Settings > Accounts and click on the Accounts tab. From here, scroll down to the Account Creation section and check the box next to “Enable customer registration on the “My Account” page”. Once you’ve done this, save your changes and take a look at the My Account page on your site.

You should now see a “Username” field where your customers can enter their username.

If you don’t want to display a “Username” field on the My Account page, you can add the username to the customer’s order confirmation email. To do this, go to WooCommerce > Settings > Emails. From here, select the “Completed Order” email template and click on the “Insert/edit link” button in the content editor. In the “URL” field, type in “{order_meta key=’_customer_user’}” (without the quotation marks). This will insert a shortcode that will pull the customer’s username from their order meta data and insert it into the email. Save your changes and test it out by placing an order on your site.

Madison Geldart

Madison Geldart

Cloud infrastructure engineer and tech mess solver.