There are a few ways to hide a snippet in WooCommerce endpoints:

  1. Using the woocommerce_endpoint_<endpoint>_title filter: You can use this filter to remove the endpoint title from the endpoint URL. For example, if your endpoint is example, you can use the following code to remove the endpoint title:
add_filter( 'woocommerce_endpoint_example_title', '__return_false' );

2. Using the woocommerce_account_menu_items filter: You can use this filter to remove the endpoint from the account menu. For example, if your endpoint is example, you can use the following code to remove the endpoint from the menu:

add_filter( 'woocommerce_account_menu_items', 'remove_example_endpoint' );
function remove_example_endpoint( $items ) {
    unset( $items['example'] );
    return $items;
}
  1. Using CSS: If you only want to hide the endpoint snippet and not remove it, you can use CSS to hide it on the front-end. For example, you can use the following code to hide the snippet with the class .example-endpoint
.example-endpoint {
    display: none;
}

It’s important to note that removing an endpoint will affect the functionality of the website, so it’s important to test the website after removing the endpoint to ensure that everything is working as expected.

(Visited 4 times, 1 visits today)
Was this article helpful?
YesNo

Leave a Reply

Your email address will not be published. Required fields are marked *

Close Search Window