How to Hide & Rename Addresses Tab My Account Page WooCommerce

WooCommerce Hide Rename Addresses Tab My Account PageCustomizing the WooCommerce “My Account” page is one of the most requested features by developers. This page is vital to the smooth running of its operations. Therefore, this page should have a clean design to allow users to make the most of account management. Moreover, you can customize this page to convert more sales or entice customers to return to your store.

WooCommerce Hide Rename Addresses Tab My Account Page

The “My Account” page is an actual WordPress page that is located under “Pages”, which contains a WooCommerce shortcode. You can use this shortcode to display the default yet complex account management tabs and their unique content on any page.

WooCommerce Hide or Rename a Tab on My Accounts Page

In this brief tutorial, you will learn how to hide and rename a “My Account” page tab using a custom PHP code snippet. If you are familiar with PHP customization, almost anything can be achieved with simple snippets.

By default, the WooCommerce My Account page looks like this:My Account Page

Steps to Hide the Address Tab on My Accounts Page

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to hide the My Accounts page’s address tab.
  3. Click anywhere on the text editor and scroll to the bottom of the functions.php file. Paste the code at the end:
/**

* @ snippet       Hide Edit Address Tab @ My Account

*/

add_filter( 'woocommerce_account_menu_items', 'njengah_remove_address_my_account', 999 );

 function njengah_remove_address_my_account( $items ) {

unset($items['edit-address']);

return $items;

}
  1. Click on the Save changes button at the bottom of the text editor screen.
  2. You have successfully added the code snippet required to hide the Addresses tab on the My Account page. This will be the outcome on the front end:Hide the Addresses tab

Steps to Rename the Addresses Tab on My Accounts Page

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to rename the address tab on the My Accounts page.
  3. Click anywhere on the text editor and scroll to the bottom of the functions.php file. Paste the code at the end:
/**

* @ snippet       Rename Edit Address Tab @ My Account

*/

add_filter( 'woocommerce_account_menu_items', 'njengah_rename_address_my_account', 999 );

function njengah_rename_address_my_account( $items ) {

$items['edit-address'] = 'Delivery Address';

return $items;

}
  1. Click on the Save changes button at the bottom of the text editor screen.
  2. You have successfully added the code snippet required to rename the Addresses tab on the My Account page. This will be the outcome on the front end:rename the addresses tab

However, if you want to disable the Addresses section on the My Account page completely, look for the account endpoints. This can be done by going to the WordPress Dashboard > WooCommerce > Settings > Advanced. Scroll down to Account Endpoints

Delete the Addresses endpoint, flush your permalinks, and the Addresses tab will be completely disabled. However, you should be very careful with these endpoints and only delete them if PHP does not work.Account endpoints

Conclusion

In this post, you have learned how to hide and rename the Addresses Tab on the My Accounts page. Make sure you follow all the steps keenly so that you do not break down your site. Moreover, I have shown you how to delete an account endpoint, but you should be very careful with these endpoints and only delete them if PHP does not work.

Similar Articles