The WooCommerce My Account page should have a good design because it is vital for smooth operation in the store. Customers in your store can use this page to make the most of the account management. Therefore, customizing this page is important to convert more sales or entice customers to return to your store.
WooCommerce Hide Any Tab My Account Page
This page is an actual page that 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.
In this brief tutorial, you will learn how to hide any 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.
Steps to Hide Any Tab on the My Account Page
By default, the WooCommerce account page looks like this:
Here are the steps that you need to follow:
- Log into your WordPress site and access the Dashboard as the admin user.
- 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 any tab on the My Accounts page.
- Click anywhere on the text editor and scroll to the bottom of the functions.php file. Paste the code at the end:
add_filter ( 'woocommerce_account_menu_items', 'njengah_remove_my_account_links' ); function njengah_remove_my_account_links( $menu_links ){ unset( $menu_links['edit-address'] ); // Addresses //unset( $menu_links['dashboard'] ); // Remove Dashboard //unset( $menu_links['payment-methods'] ); // Remove Payment Methods //unset( $menu_links['orders'] ); // Remove Orders //unset( $menu_links['downloads'] ); // Disable Downloads //unset( $menu_links['edit-account'] ); // Remove Account details tab //unset( $menu_links['customer-logout'] ); // Remove Logout link return $menu_links; }
- Click on the Save changes button at the bottom of the text editor screen.
The code works well, but when you want to remove both the menu item and its page, you do not need any coding. This is because you can find all the default My Account sub pages in WooCommerce > Settings > Advanced. Scroll down to Account Endpoints. All you need is just to set a specific endpoint empty.
Conclusion
In summary, this post shares how to hide any 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. If you are not familiar with handling code, I recommend that you hire a qualified WordPress developer.
It is important to note that these code snippets should be added to your child theme functions.php file. You can also use a Site Customization plugin so that you do not lose your changes when you update your WordPress theme.
Similar Articles
- How to Make WooCommerce Storefront Header Transparent
- How to Hide Out of Stock Visibility In WooCommerce
- How to Redirect to Cart after Login in WooCommerce
- How to Add Text after Price in WooCommerce » Add Price Suffix
- 30+ Best WordPress Gallery Plugins for Attractive Galleries
- How to Add Logout Option Menu WooCommerce Storefront Theme [Example]
- How to Hide Weight of Product in WooCommerce
- 30+ Best Comment Plugin for WordPress to Boost Engagement
- How Add Text Before the Price in WooCommerce » Add Text Before Price
- How to Change WooCommerce Storefront Layout
- How to Setup WooCommerce Storefront Blog
- How to Add WooCommerce Storefront Product Pagination
- How to Move Primary Menu Storefront WooCommerce
- How to Hide Additional Information Tab In WooCommerce
- How to Hide Errors From Visitors WooCommerce
- How to Hide Price When Out of Stock In WooCommerce
- How to Add Disclaimer Storefront WooCommerce
- Top 30+ Best WordPress Booking Plugins for Online Booking
- How to Hide Prices From Google In WooCommerce
- How to Add Search Box on Top of Page Storefront Theme