WooCommerce & Shop OperationsApr 21, 2021
Remove WooCommerce Download Section from Navigation
If you are not offering virtual products, it is advisable to disable the download section in the customer's account view.
This can be easily accomplished without a plugin. You just need to add the following 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 download section will no longer be displayed. Of course, you can also set this for the other WooCommerce links. The following endpoints are automatically provided by WooCommerce:
| orders | Orders |
| downloads | Downloads |
| edit-address | Address |
| payment-methods | Payment Methods |
| edit-account | Account Details |
| customer-logout | Logout |
If you found this article interesting, we would appreciate a comment. If you have any questions, feel free to reach out to us in the forum .