Remove WooCommerce Download section from navigation

Marc Wag­ner

April 21, 2021

1 min read|

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 cus­to­mer’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 the­me’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.

88e86fcb816eff22bc917094df2862d8dd5c0e978b333e6dd5f36f808990c261 96

Arti­kel von:

Marc Wag­ner

Hi Marc here. I’m the foun­der of Forge12 Inter­ac­ti­ve and have been pas­sio­na­te about buil­ding web­sites, online stores, appli­ca­ti­ons and SaaS solu­ti­ons for busi­nesses for over 20 years. Befo­re foun­ding the com­pa­ny, I alre­a­dy work­ed in publicly lis­ted com­pa­nies and acqui­red all kinds of know­ledge. Now I want to pass this know­ledge on to my cus­to­mers.

Hast du eine Fra­ge? Hin­ter­lass bit­te einen Kom­men­tar