Remove unused emails from Woocommerce settings emails list









up vote
1
down vote

favorite
1












A few days ago I've asked how I can rename custom email templates in WooCommerce. Now I have the problem that I have some email templates which I don't need and I want to hide these templates completely. How can I do this? I've searched on SO and Google but can't find a tutorial.



enter image description here










share|improve this question



























    up vote
    1
    down vote

    favorite
    1












    A few days ago I've asked how I can rename custom email templates in WooCommerce. Now I have the problem that I have some email templates which I don't need and I want to hide these templates completely. How can I do this? I've searched on SO and Google but can't find a tutorial.



    enter image description here










    share|improve this question

























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      A few days ago I've asked how I can rename custom email templates in WooCommerce. Now I have the problem that I have some email templates which I don't need and I want to hide these templates completely. How can I do this? I've searched on SO and Google but can't find a tutorial.



      enter image description here










      share|improve this question















      A few days ago I've asked how I can rename custom email templates in WooCommerce. Now I have the problem that I have some email templates which I don't need and I want to hide these templates completely. How can I do this? I've searched on SO and Google but can't find a tutorial.



      enter image description here







      php wordpress woocommerce email-notifications






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 21:59









      LoicTheAztec

      79.6k125992




      79.6k125992










      asked Nov 9 at 20:24









      Mr. Jo

      18019




      18019






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          Update: The right solution is using woocommerce_email_classes filter hook locate in WC_Emails Class:



          add_filter( 'woocommerce_email_classes', 'remove_specific_email_classes', 10, 1 );
          function remove_specific_email_classes( $emails )
          unset($emails['WC_Email_New_Order']);
          unset($emails['WC_Email_Cancelled_Order']);
          unset($emails['WC_Email_Failed_Order']);
          unset($emails['WC_Email_Customer_On_Hold_Order']);
          unset($emails['WC_Email_Customer_Processing_Order']);
          unset($emails['WC_Email_Customer_Completed_Order']);
          unset($emails['WC_Email_Customer_Refunded_Order']);
          unset($emails['WC_Email_Customer_Invoice']);
          unset($emails['WC_Email_Customer_Note']);
          unset($emails['WC_Email_Customer_Reset_Password']);
          unset($emails['WC_Email_Customer_New_Account']);

          return $emails;



          Code goes in function.php file of your active child theme (active theme). Tested and works.




          The following official Woocommerce documented hooked function will remove notifications action hooks:



          add_action( 'woocommerce_email', 'unhook_those_pesky_emails' );
          function unhook_those_pesky_emails( $email_class )

          //Hooks for sending emails during store events
          remove_action( 'woocommerce_low_stock_notification', array( $email_class, 'low_stock' ) );
          remove_action( 'woocommerce_no_stock_notification', array( $email_class, 'no_stock' ) );
          remove_action( 'woocommerce_product_on_backorder_notification', array( $email_class, 'backorder' ) );

          // New order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );

          // Processing order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );

          // Completed order emails
          remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );

          // Note emails
          remove_action( 'woocommerce_new_customer_note_notification', array( $email_class->emails['WC_Email_Customer_Note'], 'trigger' ) );



          Code goes in function.php file of your active child theme (active theme). Tested and works.






          share|improve this answer






















          • I've added a solution too. Which solution will be the better one?
            – Mr. Jo
            Nov 9 at 21:01

















          up vote
          0
          down vote













          This is my solution. I'm not sure whats better?



          add_filter( 'woocommerce_email_classes', 'remove_unused_emails', 15 );
          function remove_unused_emails( $email_classes )

          //Unset unused email templates
          unset( $email_classes['WC_Email_Customer_Reset_Password'] );
          unset( $email_classes['WC_Email_Customer_New_Account'] );
          unset( $email_classes['WC_Email_Customer_On_Hold_Order'] );
          unset( $email_classes['WC_GZD_Email_Customer_New_Account_Activation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Revocation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Ekomi'] );
          unset( $email_classes['WC_GZD_Email_Customer_Trusted_Shops'] );

          return $email_classes;







          share|improve this answer




















          • Yes I just find this also… It is the solution, to remove emails…
            – LoicTheAztec
            Nov 9 at 21:10










          • @LoicTheAztec so not good?
            – Mr. Jo
            Nov 9 at 21:11










          • I have updated my answer with the same hook…
            – LoicTheAztec
            Nov 9 at 21:14










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232816%2fremove-unused-emails-from-woocommerce-settings-emails-list%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          Update: The right solution is using woocommerce_email_classes filter hook locate in WC_Emails Class:



          add_filter( 'woocommerce_email_classes', 'remove_specific_email_classes', 10, 1 );
          function remove_specific_email_classes( $emails )
          unset($emails['WC_Email_New_Order']);
          unset($emails['WC_Email_Cancelled_Order']);
          unset($emails['WC_Email_Failed_Order']);
          unset($emails['WC_Email_Customer_On_Hold_Order']);
          unset($emails['WC_Email_Customer_Processing_Order']);
          unset($emails['WC_Email_Customer_Completed_Order']);
          unset($emails['WC_Email_Customer_Refunded_Order']);
          unset($emails['WC_Email_Customer_Invoice']);
          unset($emails['WC_Email_Customer_Note']);
          unset($emails['WC_Email_Customer_Reset_Password']);
          unset($emails['WC_Email_Customer_New_Account']);

          return $emails;



          Code goes in function.php file of your active child theme (active theme). Tested and works.




          The following official Woocommerce documented hooked function will remove notifications action hooks:



          add_action( 'woocommerce_email', 'unhook_those_pesky_emails' );
          function unhook_those_pesky_emails( $email_class )

          //Hooks for sending emails during store events
          remove_action( 'woocommerce_low_stock_notification', array( $email_class, 'low_stock' ) );
          remove_action( 'woocommerce_no_stock_notification', array( $email_class, 'no_stock' ) );
          remove_action( 'woocommerce_product_on_backorder_notification', array( $email_class, 'backorder' ) );

          // New order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );

          // Processing order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );

          // Completed order emails
          remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );

          // Note emails
          remove_action( 'woocommerce_new_customer_note_notification', array( $email_class->emails['WC_Email_Customer_Note'], 'trigger' ) );



          Code goes in function.php file of your active child theme (active theme). Tested and works.






          share|improve this answer






















          • I've added a solution too. Which solution will be the better one?
            – Mr. Jo
            Nov 9 at 21:01














          up vote
          1
          down vote













          Update: The right solution is using woocommerce_email_classes filter hook locate in WC_Emails Class:



          add_filter( 'woocommerce_email_classes', 'remove_specific_email_classes', 10, 1 );
          function remove_specific_email_classes( $emails )
          unset($emails['WC_Email_New_Order']);
          unset($emails['WC_Email_Cancelled_Order']);
          unset($emails['WC_Email_Failed_Order']);
          unset($emails['WC_Email_Customer_On_Hold_Order']);
          unset($emails['WC_Email_Customer_Processing_Order']);
          unset($emails['WC_Email_Customer_Completed_Order']);
          unset($emails['WC_Email_Customer_Refunded_Order']);
          unset($emails['WC_Email_Customer_Invoice']);
          unset($emails['WC_Email_Customer_Note']);
          unset($emails['WC_Email_Customer_Reset_Password']);
          unset($emails['WC_Email_Customer_New_Account']);

          return $emails;



          Code goes in function.php file of your active child theme (active theme). Tested and works.




          The following official Woocommerce documented hooked function will remove notifications action hooks:



          add_action( 'woocommerce_email', 'unhook_those_pesky_emails' );
          function unhook_those_pesky_emails( $email_class )

          //Hooks for sending emails during store events
          remove_action( 'woocommerce_low_stock_notification', array( $email_class, 'low_stock' ) );
          remove_action( 'woocommerce_no_stock_notification', array( $email_class, 'no_stock' ) );
          remove_action( 'woocommerce_product_on_backorder_notification', array( $email_class, 'backorder' ) );

          // New order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );

          // Processing order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );

          // Completed order emails
          remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );

          // Note emails
          remove_action( 'woocommerce_new_customer_note_notification', array( $email_class->emails['WC_Email_Customer_Note'], 'trigger' ) );



          Code goes in function.php file of your active child theme (active theme). Tested and works.






          share|improve this answer






















          • I've added a solution too. Which solution will be the better one?
            – Mr. Jo
            Nov 9 at 21:01












          up vote
          1
          down vote










          up vote
          1
          down vote









          Update: The right solution is using woocommerce_email_classes filter hook locate in WC_Emails Class:



          add_filter( 'woocommerce_email_classes', 'remove_specific_email_classes', 10, 1 );
          function remove_specific_email_classes( $emails )
          unset($emails['WC_Email_New_Order']);
          unset($emails['WC_Email_Cancelled_Order']);
          unset($emails['WC_Email_Failed_Order']);
          unset($emails['WC_Email_Customer_On_Hold_Order']);
          unset($emails['WC_Email_Customer_Processing_Order']);
          unset($emails['WC_Email_Customer_Completed_Order']);
          unset($emails['WC_Email_Customer_Refunded_Order']);
          unset($emails['WC_Email_Customer_Invoice']);
          unset($emails['WC_Email_Customer_Note']);
          unset($emails['WC_Email_Customer_Reset_Password']);
          unset($emails['WC_Email_Customer_New_Account']);

          return $emails;



          Code goes in function.php file of your active child theme (active theme). Tested and works.




          The following official Woocommerce documented hooked function will remove notifications action hooks:



          add_action( 'woocommerce_email', 'unhook_those_pesky_emails' );
          function unhook_those_pesky_emails( $email_class )

          //Hooks for sending emails during store events
          remove_action( 'woocommerce_low_stock_notification', array( $email_class, 'low_stock' ) );
          remove_action( 'woocommerce_no_stock_notification', array( $email_class, 'no_stock' ) );
          remove_action( 'woocommerce_product_on_backorder_notification', array( $email_class, 'backorder' ) );

          // New order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );

          // Processing order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );

          // Completed order emails
          remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );

          // Note emails
          remove_action( 'woocommerce_new_customer_note_notification', array( $email_class->emails['WC_Email_Customer_Note'], 'trigger' ) );



          Code goes in function.php file of your active child theme (active theme). Tested and works.






          share|improve this answer














          Update: The right solution is using woocommerce_email_classes filter hook locate in WC_Emails Class:



          add_filter( 'woocommerce_email_classes', 'remove_specific_email_classes', 10, 1 );
          function remove_specific_email_classes( $emails )
          unset($emails['WC_Email_New_Order']);
          unset($emails['WC_Email_Cancelled_Order']);
          unset($emails['WC_Email_Failed_Order']);
          unset($emails['WC_Email_Customer_On_Hold_Order']);
          unset($emails['WC_Email_Customer_Processing_Order']);
          unset($emails['WC_Email_Customer_Completed_Order']);
          unset($emails['WC_Email_Customer_Refunded_Order']);
          unset($emails['WC_Email_Customer_Invoice']);
          unset($emails['WC_Email_Customer_Note']);
          unset($emails['WC_Email_Customer_Reset_Password']);
          unset($emails['WC_Email_Customer_New_Account']);

          return $emails;



          Code goes in function.php file of your active child theme (active theme). Tested and works.




          The following official Woocommerce documented hooked function will remove notifications action hooks:



          add_action( 'woocommerce_email', 'unhook_those_pesky_emails' );
          function unhook_those_pesky_emails( $email_class )

          //Hooks for sending emails during store events
          remove_action( 'woocommerce_low_stock_notification', array( $email_class, 'low_stock' ) );
          remove_action( 'woocommerce_no_stock_notification', array( $email_class, 'no_stock' ) );
          remove_action( 'woocommerce_product_on_backorder_notification', array( $email_class, 'backorder' ) );

          // New order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );

          // Processing order emails
          remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
          remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );

          // Completed order emails
          remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );

          // Note emails
          remove_action( 'woocommerce_new_customer_note_notification', array( $email_class->emails['WC_Email_Customer_Note'], 'trigger' ) );



          Code goes in function.php file of your active child theme (active theme). Tested and works.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 9 at 21:13

























          answered Nov 9 at 20:48









          LoicTheAztec

          79.6k125992




          79.6k125992











          • I've added a solution too. Which solution will be the better one?
            – Mr. Jo
            Nov 9 at 21:01
















          • I've added a solution too. Which solution will be the better one?
            – Mr. Jo
            Nov 9 at 21:01















          I've added a solution too. Which solution will be the better one?
          – Mr. Jo
          Nov 9 at 21:01




          I've added a solution too. Which solution will be the better one?
          – Mr. Jo
          Nov 9 at 21:01












          up vote
          0
          down vote













          This is my solution. I'm not sure whats better?



          add_filter( 'woocommerce_email_classes', 'remove_unused_emails', 15 );
          function remove_unused_emails( $email_classes )

          //Unset unused email templates
          unset( $email_classes['WC_Email_Customer_Reset_Password'] );
          unset( $email_classes['WC_Email_Customer_New_Account'] );
          unset( $email_classes['WC_Email_Customer_On_Hold_Order'] );
          unset( $email_classes['WC_GZD_Email_Customer_New_Account_Activation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Revocation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Ekomi'] );
          unset( $email_classes['WC_GZD_Email_Customer_Trusted_Shops'] );

          return $email_classes;







          share|improve this answer




















          • Yes I just find this also… It is the solution, to remove emails…
            – LoicTheAztec
            Nov 9 at 21:10










          • @LoicTheAztec so not good?
            – Mr. Jo
            Nov 9 at 21:11










          • I have updated my answer with the same hook…
            – LoicTheAztec
            Nov 9 at 21:14














          up vote
          0
          down vote













          This is my solution. I'm not sure whats better?



          add_filter( 'woocommerce_email_classes', 'remove_unused_emails', 15 );
          function remove_unused_emails( $email_classes )

          //Unset unused email templates
          unset( $email_classes['WC_Email_Customer_Reset_Password'] );
          unset( $email_classes['WC_Email_Customer_New_Account'] );
          unset( $email_classes['WC_Email_Customer_On_Hold_Order'] );
          unset( $email_classes['WC_GZD_Email_Customer_New_Account_Activation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Revocation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Ekomi'] );
          unset( $email_classes['WC_GZD_Email_Customer_Trusted_Shops'] );

          return $email_classes;







          share|improve this answer




















          • Yes I just find this also… It is the solution, to remove emails…
            – LoicTheAztec
            Nov 9 at 21:10










          • @LoicTheAztec so not good?
            – Mr. Jo
            Nov 9 at 21:11










          • I have updated my answer with the same hook…
            – LoicTheAztec
            Nov 9 at 21:14












          up vote
          0
          down vote










          up vote
          0
          down vote









          This is my solution. I'm not sure whats better?



          add_filter( 'woocommerce_email_classes', 'remove_unused_emails', 15 );
          function remove_unused_emails( $email_classes )

          //Unset unused email templates
          unset( $email_classes['WC_Email_Customer_Reset_Password'] );
          unset( $email_classes['WC_Email_Customer_New_Account'] );
          unset( $email_classes['WC_Email_Customer_On_Hold_Order'] );
          unset( $email_classes['WC_GZD_Email_Customer_New_Account_Activation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Revocation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Ekomi'] );
          unset( $email_classes['WC_GZD_Email_Customer_Trusted_Shops'] );

          return $email_classes;







          share|improve this answer












          This is my solution. I'm not sure whats better?



          add_filter( 'woocommerce_email_classes', 'remove_unused_emails', 15 );
          function remove_unused_emails( $email_classes )

          //Unset unused email templates
          unset( $email_classes['WC_Email_Customer_Reset_Password'] );
          unset( $email_classes['WC_Email_Customer_New_Account'] );
          unset( $email_classes['WC_Email_Customer_On_Hold_Order'] );
          unset( $email_classes['WC_GZD_Email_Customer_New_Account_Activation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Revocation'] );
          unset( $email_classes['WC_GZD_Email_Customer_Ekomi'] );
          unset( $email_classes['WC_GZD_Email_Customer_Trusted_Shops'] );

          return $email_classes;








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 9 at 20:55









          Mr. Jo

          18019




          18019











          • Yes I just find this also… It is the solution, to remove emails…
            – LoicTheAztec
            Nov 9 at 21:10










          • @LoicTheAztec so not good?
            – Mr. Jo
            Nov 9 at 21:11










          • I have updated my answer with the same hook…
            – LoicTheAztec
            Nov 9 at 21:14
















          • Yes I just find this also… It is the solution, to remove emails…
            – LoicTheAztec
            Nov 9 at 21:10










          • @LoicTheAztec so not good?
            – Mr. Jo
            Nov 9 at 21:11










          • I have updated my answer with the same hook…
            – LoicTheAztec
            Nov 9 at 21:14















          Yes I just find this also… It is the solution, to remove emails…
          – LoicTheAztec
          Nov 9 at 21:10




          Yes I just find this also… It is the solution, to remove emails…
          – LoicTheAztec
          Nov 9 at 21:10












          @LoicTheAztec so not good?
          – Mr. Jo
          Nov 9 at 21:11




          @LoicTheAztec so not good?
          – Mr. Jo
          Nov 9 at 21:11












          I have updated my answer with the same hook…
          – LoicTheAztec
          Nov 9 at 21:14




          I have updated my answer with the same hook…
          – LoicTheAztec
          Nov 9 at 21:14

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232816%2fremove-unused-emails-from-woocommerce-settings-emails-list%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kleinkühnau

          Makov (Slowakei)

          Deutsches Schauspielhaus