WooCommerce - Remove downloads from menu in my account page

PhpWordpressWoocommerceSettingsAccount

Php Problem Overview


I would like to remove downloads menu from my account page.

How can I do this? Is it any hook to remove a specific item from the menu?

Thanks.

Php Solutions


Solution 1 - Php

Go to WooCommerce > Settings > Advanced and remove the entry for Downloads in the Account endpoints section, just leave it blank. And the menu will not be visible anymore.

remove downloads link

Solution 2 - Php

You will need this lightly customized this code snippet:

function custom_my_account_menu_items( $items ) {
    unset($items['downloads']);
    return $items;
}
add_filter( 'woocommerce_account_menu_items', 'custom_my_account_menu_items' );

This code goes on function.php file of your active child theme (or theme) or in any plugin file.

This code is tested and working

Solution 3 - Php

[data-tab="downloads"] {
    display: none!important;
}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questiontechiva.blogspot.comView Question on Stackoverflow
Solution 1 - PhpChristophvhView Answer on Stackoverflow
Solution 2 - PhpLoicTheAztecView Answer on Stackoverflow
Solution 3 - PhpSeanView Answer on Stackoverflow