WordPress filter hook · part of WordPress core

wp_mail_content_type

A WordPress core filter that 126 plugins also fire themselves, running on 2.2M+ sites between them.

“Filters the wp_mail() content type.”

How to use wp_mail_content_type

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wp_mail_content_type', function( $content_type ) {
	// Change $content_type here.
	return $content_type;
}, 10, 1 );

Argument names come from FluentSMTP's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

126 plugins that fire wp_mail_content_type

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. FluentSMTP icon FluentSMTP700,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) app/Functions/helpers.php:694
  2. Post SMTP icon Post SMTP300,000+ installs apply_filters( 'wp_mail_content_type', $this->getContentType() ) Postman/Postman-Mail/PostmanMessage.php:219
  3. WP Mail Logging icon WP Mail Logging300,000+ installs apply_filters( 'wp_mail_content_type', 'text/html' ) src/WPML_Plugin.php:579
  4. SureMail icon SureMail200,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) inc/emails/default-mail-handler.php:324
  5. Brevo icon Brevo100,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) inc/function.wp_mail.php:201
  6. BuddyPress icon BuddyPress90,000+ installs apply_filters( 'wp_mail_content_type', 'text/plain' ) bp-core/bp-core-functions.php:3801
  7. Check & Log Email icon Check & Log Email90,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) include/helper-function.php:392
  8. Mailgun for WordPress icon Mailgun for WordPress70,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/wp-mail-api.php:641
  9. SMTP Mailer icon SMTP Mailer70,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) main.php:973
  10. ActiveCampaign Postmark for WordPress icon ActiveCampaign Postmark for WordPress50,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) wp-mail.php:154
  11. Disable Emails icon Disable Emails30,000+ installs apply_filters( 'wp_mail_content_type', $this->phpmailer->ContentType ) includes/class.PHPMailerMock.php:213
  12. Uncanny Toolkit for LearnDash icon Uncanny Toolkit for LearnDash20,000+ installs apply_filters( 'wp_mail_content_type', 'text/html' ) src/classes/frontend-login-plus.php:837
  13. MainWP Dashboard: Self-hosted WordPress Management for Agencies icon MainWP Dashboard: Self-hosted WordPress Management for Agencies20,000+ installs apply_filters( 'wp_mail_content_type', 'text/plain' ) modules/remote-mcp/class-remote-mcp-notices.php:355
  14. Email Template Designer icon Email Template Designer20,000+ installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-haet-mail.php:519
  15. Zoho Mail for WordPress icon Zoho Mail for WordPress20,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) zohoMail.php:897
  16. Branda icon Branda10,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) inc/modules/emails/google-oauth.php:526
  17. Gmail SMTP icon Gmail SMTP10,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) main.php:1064
  18. Elastic Email Sender icon Elastic Email Sender10,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) class/ees_mail.php:158
  19. WP Offload SES Lite icon WP Offload SES Lite10,000+ installs apply_filters( 'wp_mail_content_type', 'text/plain' ) classes/Email.php:524
  20. Swift SMTP (formerly Welcome Email Editor) icon Swift SMTP (formerly Welcome Email Editor)7,000+ installs apply_filters( 'wp_mail_content_type', ! empty( $parsed_headers['content_type'] ) ? $parsed_headers['content_type'] : 'text/plain' ) modules/mailjet-api/class-mailjet-api-sender.php:79
  21. Send Emails with Mandrill icon Send Emails with Mandrill6,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) legacy/function.wp_mail.php:204
  22. Zoho ZeptoMail icon Zoho ZeptoMail5,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) transMail.php:1095
  23. WPMasterToolKit (WPMTK) icon WPMasterToolKit (WPMTK)5,000+ installs apply_filters( 'wp_mail_content_type', 'text/html' ) admin/modules/core/class-mail-catcher.php:502
  24. Checkout with Zelle on Woocommerce icon Checkout with Zelle on Woocommerce3,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/functions/zoho.php:156
  25. SmartSMTP icon SmartSMTP2,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/Services/Services.php:476
  26. Groundhogg icon Groundhogg2,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/pluggable.php:469
  27. WP Email Template icon WP Email Template2,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) classes/class-email-hook.php:289
  28. Bit SMTP icon Bit SMTP2,000+ installs apply_filters( 'wp_mail_content_type', $headerType->filterValue() ) backend/app/Mail/Message/MailMessageFactory.php:184
  29. Easy Appointment Booking & Scheduling Plugin icon Easy Appointment Booking & Scheduling Plugin2,000+ installs apply_filters( 'wp_mail_content_type', "text/plain" ) includes/utilities/class-wbk-mailer.php:385
  30. Sailthru for WordPress icon Sailthru for WordPress1,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) sailthru-wpmail.php:264
  31. WPO365 icon WPO3651,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) mail_integration_365.php:189
  32. Appointment Bookings for Zoom GoogleMeet and more icon Appointment Bookings for Zoom GoogleMeet and more1,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) app/Transports/WpMailPatched.php:278
  33. Meow Mailer icon Meow Mailer1,000+ installs apply_filters( 'wp_mail_content_type', $content_type ) classes/modules/mailer.php:693
  34. Mail Queue icon Mail Queue1,000+ installs apply_filters( 'wp_mail_content_type', 'text/plain' ) mail-queue.php:385
  35. Infinite Uploads icon Infinite Uploads800+ installs apply_filters( 'wp_mail_content_type', $content_type ) inc/InfiniteUploadsWPMail.php:353
  36. SocketLabs icon SocketLabs800+ installs apply_filters( 'wp_mail_content_type', $this->content_type ) includes/class-socketlabs-mailer.php:277
  37. Connect SendGrid for Emails icon Connect SendGrid for Emails800+ installs apply_filters( 'wp_mail_content_type', $content_type ) lib/sendgrid/sendgrid-wp-mail.php:347
  38. Mail Baby SMTP icon Mail Baby SMTP500+ installs apply_filters( 'wp_mail_content_type', $content_type ) inc/Gmail_SMTP_Manager.php:3104
  39. Lettermint icon Lettermint500+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-lettermint-mailer.php:89
  40. Resend icon Resend500+ installs apply_filters( 'wp_mail_content_type', $content_type ) wp-mail.php:86
  41. turboSMTP icon turboSMTP400+ installs apply_filters( 'wp_mail_content_type', $data['content-type'] ) public/class-turbosmtp-public.php:166
  42. aDirectory icon aDirectory300+ installs apply_filters( 'wp_mail_content_type', $content_type ) inc/EmailSender.php:321
  43. MailHawk icon MailHawk200+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/pluggable.php:433
  44. Custom SMTP: Email Deliverability icon Custom SMTP: Email Deliverability200+ installs apply_filters( 'wp_mail_content_type', $content_type ) src/Mail/SesMailer.php:753
  45. Elastic Email Subscribe Form icon Elastic Email Subscribe Form100+ installs apply_filters( 'wp_mail_content_type', $content_type ) defaults/function.wp_mail.php:224
  46. MailArchiver icon MailArchiver100+ installs apply_filters( 'wp_mail_content_type', $content_type ) functions.php:342
  47. Zoho ZeptoMail for WooCommerce icon Zoho ZeptoMail for WooCommerce100+ installs apply_filters( 'wp_mail_content_type', '' ) includes/class-zeptomail-woocommerce-send.php:204
  48. WP Email Delivery icon WP Email Delivery100+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-wp-email-delivery-connections.php:304
  49. WP SendGrid icon WP SendGrid100+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/wp-mail.php:161
  50. AIO Tools (All in One Tools) icon AIO Tools (All in One Tools)100+ installs apply_filters( 'wp_mail_content_type', '' !== $content_type ? $content_type : 'text/plain' ) modules/smtp/class-aio-mailer.php:638
  51. VuloMail icon VuloMail100+ installs apply_filters( 'wp_mail_content_type', '' === $content_type ? 'text/plain' : $content_type ) classes/Email/MessageFactory.php:108
  52. Freshjet icon Freshjet90+ installs apply_filters( 'wp_mail_content_type', 'text/plain' ) class-email.php:116
  53. SMTP.com icon SMTP.com80+ installs apply_filters( 'wp_mail_content_type', $content_type ) admin/mail-api.php:294
  54. Zoho Mail for WooCommerce icon Zoho Mail for WooCommerce80+ installs apply_filters( 'wp_mail_content_type', '' ) includes/class-zohomail-woocommerce-send.php:121
  55. PostmarkApp Email Integrator icon PostmarkApp Email Integrator50+ installs apply_filters( 'wp_mail_content_type', isset( $recognized_headers['Content-Type'] ) ? $recognized_headers['Content-Type'] : 'text/plain' ) postmarkapp.php:302
  56. Kaddora MailFlow SMTP icon Kaddora MailFlow SMTP40+ installs apply_filters( 'wp_mail_content_type', $default_type ) includes/mail/class-kms-email-normalizer.php:499
  57. Gmail Mailer icon Gmail Mailer30+ installs apply_filters( 'wp_mail_content_type', $content_type ) main.php:685
  58. Mail Queues by PBCI icon Mail Queues by PBCI30+ installs apply_filters( 'wp_mail_content_type', $content_type ) pbci-mail.php:745
  59. SendForce Mail SMTP Relay icon SendForce Mail SMTP Relay30+ installs apply_filters( 'wp_mail_content_type', $type ) includes/class-sendforce-mailer.php:803
  60. SMTP Mailer by ReadyGo icon SMTP Mailer by ReadyGo20+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-rgt-smtp-mailer.php:279
  61. VR SMTP Mailer icon VR SMTP Mailer20+ installs apply_filters( 'wp_mail_content_type', $content_type ) mail/GraphMailer.php:52
  62. Authentic Sender icon Authentic Sender20+ installs apply_filters( 'wp_mail_content_type', $parsed['content_type'] ) includes/class-api-mailer.php:525
  63. API Mailer for AWS SES icon API Mailer for AWS SES20+ installs apply_filters( 'wp_mail_content_type', $content_type ) src/Mail/Mailer.php:257
  64. Check-Mail-SMTP icon Check-Mail-SMTP10+ installs apply_filters( 'wp_mail_content_type', $content_type ) main.php:734
  65. Mailaura Newsletter icon Mailaura Newsletter10+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-mailaura-email-delivery.php:259
  66. Titanium Mail SMTP icon Titanium Mail SMTP10+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-tmsmtp-api-mailers.php:56
  67. Vulners Scanner icon Vulners Scanner10+ installs apply_filters( 'wp_mail_content_type', 'text/html' ) Cron.php:194
  68. Sendelva icon Sendelva10+ installs apply_filters( 'wp_mail_content_type', $parsed['content_type'] ) sendelva.php:251
  69. ElasticEmail Plugin icon ElasticEmail Plugin10+ installs apply_filters( 'wp_mail_content_type', $content_type ) elasticemail.php:399
  70. Stars SMTP Mailer icon Stars SMTP Mailer10+ installs apply_filters( 'wp_mail_content_type', $content_type ) action/stars_function.php:470
  71. Big Mailer icon Big Mailer10+ installs apply_filters( 'wp_mail_content_type', $content_type ) BigMailer.php:249
  72. SMTP King Pro icon SMTP King Pro10+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/admin_area.php:223
  73. Lean SMTP icon Lean SMTP10+ installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-lean-smtp-mailer.php:525
  74. SwiftTrap for Mailtrap icon SwiftTrap for Mailtrap10+ installs apply_filters( 'wp_mail_content_type', $content_type ) swifttrap-for-mailtrap.php:316
  75. Set email headers and from address icon Set email headers and from address10+ installs apply_filters( 'wp_mail_content_type', $content_type ) dg-set-from-address.php:343
  76. Guard Dog icon Guard Dog10+ installs apply_filters( 'wp_mail_content_type', $parsed_headers['content_type'] ) includes/features/class-email-provider.php:1720
  77. Enhanced Emails icon Enhanced Emails10+ installs apply_filters( 'wp_mail_content_type', $content_type ) pluggable.php:217
  78. Trigger icon TriggerFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) inc/Core/TriggerMailer.php:340
  79. Avang Email Sender No Spam icon Avang Email Sender No SpamFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) defaults/function.wp_mail.php:224
  80. eusend icon eusendFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-eusend-mailer.php:240
  81. Mailkeep icon MailkeepFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-mailkeep.php:369
  82. Vibr Email Rules icon Vibr Email RulesFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-vber-mail.php:252
  83. SendBeam icon SendBeamFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) includes/mail.php:166
  84. Volanea Email Delivery icon Volanea Email DeliveryFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/mailer.php:687
  85. SendFleet icon SendFleetFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-message-builder.php:260
  86. Codo Mailer icon Codo MailerFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) src/Mail/MessageFactory.php:87
  87. Connector for bluefox.email icon Connector for bluefox.emailFewer than 10 installs apply_filters( 'wp_mail_content_type', $type ) modules/mailer/class-mailer.php:284
  88. Hiveify icon HiveifyFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) hiveify.php:292
  89. GlobalDev SMTP icon GlobalDev SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-gds-providers.php:147
  90. SMTPing Email Suite: SMTP, Newsletter & Email Verification icon SMTPing Email Suite: SMTP, Newsletter & Email VerificationFewer than 10 installs apply_filters( 'wp_mail_content_type', $ct ) includes/class-smtping-smtp-message.php:115
  91. Sprint Newsletter icon Sprint NewsletterFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/html' ) src/Delivery/FinalPreview.php:168
  92. Vora SMTP icon Vora SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) vora-smtp.php:172
  93. Duva Mail icon Duva MailFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-duva-mail-request.php:111
  94. Aluleth SMTP icon Aluleth SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-message.php:143
  95. Dealroot icon DealrootFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-mail-tags.php:177
  96. Rewind Form Bridge for Brevo icon Rewind Form Bridge for BrevoFewer than 10 installs apply_filters( 'wp_mail_content_type', '' !== $headers['content_type'] ? $headers['content_type'] : 'text/plain' ) includes/Emails/class-mailer.php:207
  97. Uptonica icon UptonicaFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-uptonica-mail.php:60
  98. ESoftWave Project Manager icon ESoftWave Project ManagerFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-eswpm-mail-design.php:185
  99. CapyScout icon CapyScoutFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-capyscout-sources.php:242
  100. OneTrace for WooCommerce icon OneTrace for WooCommerceFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) src/StoreEmails.php:453
  101. Emercury SMTP Mail icon Emercury SMTP MailFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) src/Core/Mailer.php:136
  102. Mailyard icon MailyardFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-message.php:139
  103. EnjinMel SMTP icon EnjinMel SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-enjinmel-smtp-api-client.php:184
  104. Kelune SMTP icon Kelune SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) includes/Mailer/PhpMailerBuilder.php:241
  105. Venmail SMTP and Lead Finder icon Venmail SMTP and Lead FinderFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) venmail-smtp-and-lead-finder.php:46
  106. Kaiizen Mail Log icon Kaiizen Mail LogFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-mail-catcher.php:378
  107. ByteCoreStack icon ByteCoreStackFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-bcs-smtp-mailer.php:162
  108. MountDev Email Delivery for Cloudflare icon MountDev Email Delivery for CloudflareFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-mailer.php:192
  109. Lettr icon LettrFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) wp-mail.php:161
  110. Postkeep icon PostkeepFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) includes/smtp-manager/class-smtp-mailer.php:1330
  111. Resonanz Email Rerouting icon Resonanz Email ReroutingFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) inc/email-rerouting.php:557
  112. Silent Threads Security icon Silent Threads SecurityFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-wpmm-email-template.php:71
  113. SMTP Senpai icon SMTP SenpaiFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) includes/class-smtp-senpai-mailer.php:467
  114. TrackFormPro icon TrackFormProFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/lead-email-source.php:150
  115. NimblyMail SMTP icon NimblyMail SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) src/Sandbox/SandboxInterceptor.php:455
  116. MazeSMTP icon MazeSMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', $content_type ) app/Mail/MimeBuilder.php:168
  117. meil.ro icon meil.roFewer than 10 installs apply_filters( 'wp_mail_content_type', $parsed['content_type'] ) includes/class-meil-mailer.php:71
  118. Sendfeather SMTP icon Sendfeather SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-mailer.php:150
  119. Mersal SMTP icon Mersal SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', '' !== $h['content_type'] ? $h['content_type'] : 'text/plain' ) includes/class-mersal-smtp-mailer.php:175
  120. PureMails icon PureMailsFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/Design.php:70
  121. GhostParse icon GhostParseFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-mailer.php:40
  122. Freexya icon FreexyaFewer than 10 installs apply_filters( 'wp_mail_content_type', $type ) modules/Mail/Transport.php:264
  123. Letterkeep Contact Form icon Letterkeep Contact FormFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/class-letterkeep-mailer.php:84
  124. OG Connectors icon OG ConnectorsFewer than 10 installs apply_filters( 'wp_mail_content_type', $out['type'] ) backend/app/extensions/connectors/handlers/MailsHandler.php:65
  125. Cybexsoft SMTP icon Cybexsoft SMTPFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) includes/mailers/class-mailer-base.php:371
  126. APPideas Email Holinator icon APPideas Email HolinatorFewer than 10 installs apply_filters( 'wp_mail_content_type', 'text/plain' ) inc/class-aieh-mail-interceptor.php:929

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.