Skip to content

Instantly share code, notes, and snippets.

@bekarice
Last active February 5, 2022 21:52
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Remove "My Memberships" table on My Account with WooCommerce Memberships
<?php // Only copy this line if needed
/**
* Removes the "My Memberships" table from my account area
*/
function sv_remove_my_memberships_table() {
if ( function_exists( 'wc_memberships' ) && ! is_admin() ) {
remove_action( 'woocommerce_before_my_account', array( wc_memberships()->get_frontend_instance()->get_members_area_instance(), 'my_account_memberships' ) );
}
}
add_action( 'init', 'sv_remove_my_memberships_table', 50 );
@BoyetDgte
Copy link

The easiest way to do this without PHP is to go to Woocommerce > Settings > Advanced and then delete the text in the My Membership End Point.

It will remove the tab from the My Accounts Page.

image

Why do we need the snippet when we have the settings :) Thanks Man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment