Remove WooCommerce Download section from navigation

Marc Wagner, July 22, 2022

If you are not offe­ring vir­tu­al pro­ducts, it is recom­men­ded to disable the down­load sec­tion in the customer’s account view.

This can be done easi­ly wit­hout a plug­in. All you have to do is add the fol­lo­wing code to your theme’s Functions.php.

/**
 * Remove WooCommerce Download Section
 */
function removeWooCommerceDownloadSection($items) {
   unset( $items['downloads'] );
   return $items;
}
add_filter('woocommerce_account_menu_items', 'removeWooCommerceDownloadSection', 10, 1);

Now, the link to the down­load sec­tion will no lon­ger be dis­play­ed. Of cour­se, you can set this for the other Woo­Com­mer­ce links as well. The fol­lo­wing end­points are auto­ma­ti­cal­ly offe­red by Woo­Com­mer­ce:

ordersOrders
down­loadsDown­loads
edit-addressAdress
pay­ment-methodsPay­ment Methods
edit-accountKon­to-Details
cus­to­mer-log­outLog­out

If you found this artic­le inte­res­t­ing, we would be hap­py to recei­ve your comm­ents. If you have any ques­ti­ons, plea­se feel free to cont­act us in the forum.

Avatar of Marc Wagner
Marc Wagner

Hi Marc here. I'm the founder of Forge12 Interactive and have been passionate about building websites, online stores, applications and SaaS solutions for businesses for over 20 years. Before founding the company, I already worked in publicly listed companies and acquired all kinds of knowledge. Now I want to pass this knowledge on to my customers.

Similar Topics

Comments

Leave A Comment