How to hide communication preferences from My Account#
ShopMagic adds a Communication section to the WooCommerce My Account menu. To disable this account integration, add the following PHP filter to your child theme's functions.php file or a custom plugin:
add_filter( 'shopmagic/core/communication_type/account_page_show', '__return_false' );
If you add the snippet to an existing PHP file, place it inside the PHP code without adding another <?php opening tag. Using a child theme prevents a parent theme update from overwriting the change.
What changes after adding the filter?#
- The Communication menu item and its ShopMagic content are no longer added to My Account.
- New links generated by
{{ customer.unsubscribe_url }}point to ShopMagic's standalone communication preferences page, including for registered customers. - Existing subscriptions remain unchanged. Customers can still manage their preferences through a valid standalone link.
Note: Links in previously sent emails are not updated. Registered customers' older links may still point to the My Account section you have disabled. Send a new test email and check the newly generated preferences link after applying the filter.
How to restore the My Account section#
Remove the filter and save the file. With WooCommerce active, ShopMagic will add the Communication section to My Account again.
