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:
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.
-
FluentSMTP700,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )app/Functions/helpers.php:694 -
Post SMTP300,000+ installs
apply_filters( 'wp_mail_content_type', $this->getContentType() )Postman/Postman-Mail/PostmanMessage.php:219 -
WP Mail Logging300,000+ installs
apply_filters( 'wp_mail_content_type', 'text/html' )src/WPML_Plugin.php:579 -
SureMail200,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )inc/emails/default-mail-handler.php:324 -
Brevo100,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )inc/function.wp_mail.php:201 -
BuddyPress90,000+ installs
apply_filters( 'wp_mail_content_type', 'text/plain' )bp-core/bp-core-functions.php:3801 -
Check & Log Email90,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )include/helper-function.php:392 -
Mailgun for WordPress70,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/wp-mail-api.php:641 -
SMTP Mailer70,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )main.php:973 -
ActiveCampaign Postmark for WordPress50,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )wp-mail.php:154 -
Disable Emails30,000+ installs
apply_filters( 'wp_mail_content_type', $this->phpmailer->ContentType )includes/class.PHPMailerMock.php:213 -
Uncanny Toolkit for LearnDash20,000+ installs
apply_filters( 'wp_mail_content_type', 'text/html' )src/classes/frontend-login-plus.php:837 -
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 -
Email Template Designer20,000+ installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-haet-mail.php:519 -
Zoho Mail for WordPress20,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )zohoMail.php:897 -
Branda10,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )inc/modules/emails/google-oauth.php:526 -
Gmail SMTP10,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )main.php:1064 -
Elastic Email Sender10,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )class/ees_mail.php:158 -
WP Offload SES Lite10,000+ installs
apply_filters( 'wp_mail_content_type', 'text/plain' )classes/Email.php:524 -
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 -
Send Emails with Mandrill6,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )legacy/function.wp_mail.php:204 -
Zoho ZeptoMail5,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )transMail.php:1095 -
WPMasterToolKit (WPMTK)5,000+ installs
apply_filters( 'wp_mail_content_type', 'text/html' )admin/modules/core/class-mail-catcher.php:502 -
Checkout with Zelle on Woocommerce3,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/functions/zoho.php:156 -
SmartSMTP2,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/Services/Services.php:476 -
Groundhogg2,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/pluggable.php:469 -
WP Email Template2,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )classes/class-email-hook.php:289 -
Bit SMTP2,000+ installs
apply_filters( 'wp_mail_content_type', $headerType->filterValue() )backend/app/Mail/Message/MailMessageFactory.php:184 -
Easy Appointment Booking & Scheduling Plugin2,000+ installs
apply_filters( 'wp_mail_content_type', "text/plain" )includes/utilities/class-wbk-mailer.php:385 -
Sailthru for WordPress1,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )sailthru-wpmail.php:264 -
WPO3651,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )mail_integration_365.php:189 -
Appointment Bookings for Zoom GoogleMeet and more1,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )app/Transports/WpMailPatched.php:278 -
Meow Mailer1,000+ installs
apply_filters( 'wp_mail_content_type', $content_type )classes/modules/mailer.php:693 -
Mail Queue1,000+ installs
apply_filters( 'wp_mail_content_type', 'text/plain' )mail-queue.php:385 -
Infinite Uploads800+ installs
apply_filters( 'wp_mail_content_type', $content_type )inc/InfiniteUploadsWPMail.php:353 -
SocketLabs800+ installs
apply_filters( 'wp_mail_content_type', $this->content_type )includes/class-socketlabs-mailer.php:277 -
Connect SendGrid for Emails800+ installs
apply_filters( 'wp_mail_content_type', $content_type )lib/sendgrid/sendgrid-wp-mail.php:347 -
Mail Baby SMTP500+ installs
apply_filters( 'wp_mail_content_type', $content_type )inc/Gmail_SMTP_Manager.php:3104 -
Lettermint500+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-lettermint-mailer.php:89 -
Resend500+ installs
apply_filters( 'wp_mail_content_type', $content_type )wp-mail.php:86 -
turboSMTP400+ installs
apply_filters( 'wp_mail_content_type', $data['content-type'] )public/class-turbosmtp-public.php:166 -
aDirectory300+ installs
apply_filters( 'wp_mail_content_type', $content_type )inc/EmailSender.php:321 -
MailHawk200+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/pluggable.php:433 -
Custom SMTP: Email Deliverability200+ installs
apply_filters( 'wp_mail_content_type', $content_type )src/Mail/SesMailer.php:753 -
Elastic Email Subscribe Form100+ installs
apply_filters( 'wp_mail_content_type', $content_type )defaults/function.wp_mail.php:224 -
MailArchiver100+ installs
apply_filters( 'wp_mail_content_type', $content_type )functions.php:342 -
Zoho ZeptoMail for WooCommerce100+ installs
apply_filters( 'wp_mail_content_type', '' )includes/class-zeptomail-woocommerce-send.php:204 -
WP Email Delivery100+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-wp-email-delivery-connections.php:304 -
WP SendGrid100+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/wp-mail.php:161 -
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 -
VuloMail100+ installs
apply_filters( 'wp_mail_content_type', '' === $content_type ? 'text/plain' : $content_type )classes/Email/MessageFactory.php:108 -
Freshjet90+ installs
apply_filters( 'wp_mail_content_type', 'text/plain' )class-email.php:116 -
SMTP.com80+ installs
apply_filters( 'wp_mail_content_type', $content_type )admin/mail-api.php:294 -
Zoho Mail for WooCommerce80+ installs
apply_filters( 'wp_mail_content_type', '' )includes/class-zohomail-woocommerce-send.php:121 -
PostmarkApp Email Integrator50+ installs
apply_filters( 'wp_mail_content_type', isset( $recognized_headers['Content-Type'] ) ? $recognized_headers['Content-Type'] : 'text/plain' )postmarkapp.php:302 -
Kaddora MailFlow SMTP40+ installs
apply_filters( 'wp_mail_content_type', $default_type )includes/mail/class-kms-email-normalizer.php:499 -
Gmail Mailer30+ installs
apply_filters( 'wp_mail_content_type', $content_type )main.php:685 -
Mail Queues by PBCI30+ installs
apply_filters( 'wp_mail_content_type', $content_type )pbci-mail.php:745 -
SendForce Mail SMTP Relay30+ installs
apply_filters( 'wp_mail_content_type', $type )includes/class-sendforce-mailer.php:803 -
SMTP Mailer by ReadyGo20+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-rgt-smtp-mailer.php:279 -
VR SMTP Mailer20+ installs
apply_filters( 'wp_mail_content_type', $content_type )mail/GraphMailer.php:52 -
Authentic Sender20+ installs
apply_filters( 'wp_mail_content_type', $parsed['content_type'] )includes/class-api-mailer.php:525 -
API Mailer for AWS SES20+ installs
apply_filters( 'wp_mail_content_type', $content_type )src/Mail/Mailer.php:257 -
Check-Mail-SMTP10+ installs
apply_filters( 'wp_mail_content_type', $content_type )main.php:734 -
Mailaura Newsletter10+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-mailaura-email-delivery.php:259 -
Titanium Mail SMTP10+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-tmsmtp-api-mailers.php:56 -
Vulners Scanner10+ installs
apply_filters( 'wp_mail_content_type', 'text/html' )Cron.php:194 -
Sendelva10+ installs
apply_filters( 'wp_mail_content_type', $parsed['content_type'] )sendelva.php:251 -
ElasticEmail Plugin10+ installs
apply_filters( 'wp_mail_content_type', $content_type )elasticemail.php:399 -
Stars SMTP Mailer10+ installs
apply_filters( 'wp_mail_content_type', $content_type )action/stars_function.php:470 -
Big Mailer10+ installs
apply_filters( 'wp_mail_content_type', $content_type )BigMailer.php:249 -
SMTP King Pro10+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/admin_area.php:223 -
Lean SMTP10+ installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-lean-smtp-mailer.php:525 -
SwiftTrap for Mailtrap10+ installs
apply_filters( 'wp_mail_content_type', $content_type )swifttrap-for-mailtrap.php:316 -
Set email headers and from address10+ installs
apply_filters( 'wp_mail_content_type', $content_type )dg-set-from-address.php:343 -
Guard Dog10+ installs
apply_filters( 'wp_mail_content_type', $parsed_headers['content_type'] )includes/features/class-email-provider.php:1720 -
Enhanced Emails10+ installs
apply_filters( 'wp_mail_content_type', $content_type )pluggable.php:217 -
TriggerFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )inc/Core/TriggerMailer.php:340 -
Avang Email Sender No SpamFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )defaults/function.wp_mail.php:224 -
eusendFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-eusend-mailer.php:240 -
MailkeepFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-mailkeep.php:369 -
Vibr Email RulesFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-vber-mail.php:252 -
SendBeamFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )includes/mail.php:166 -
Volanea Email DeliveryFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/mailer.php:687 -
SendFleetFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-message-builder.php:260 -
Codo MailerFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )src/Mail/MessageFactory.php:87 -
Connector for bluefox.emailFewer than 10 installs
apply_filters( 'wp_mail_content_type', $type )modules/mailer/class-mailer.php:284 -
HiveifyFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )hiveify.php:292 -
GlobalDev SMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-gds-providers.php:147 -
SMTPing Email Suite: SMTP, Newsletter & Email VerificationFewer than 10 installs
apply_filters( 'wp_mail_content_type', $ct )includes/class-smtping-smtp-message.php:115 -
Sprint NewsletterFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/html' )src/Delivery/FinalPreview.php:168 -
Vora SMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )vora-smtp.php:172 -
Duva MailFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-duva-mail-request.php:111 -
Aluleth SMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-message.php:143 -
DealrootFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-mail-tags.php:177 -
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 -
UptonicaFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-uptonica-mail.php:60 -
ESoftWave Project ManagerFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-eswpm-mail-design.php:185 -
CapyScoutFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-capyscout-sources.php:242 -
OneTrace for WooCommerceFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )src/StoreEmails.php:453 -
Emercury SMTP MailFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )src/Core/Mailer.php:136 -
MailyardFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-message.php:139 -
EnjinMel SMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-enjinmel-smtp-api-client.php:184 -
Kelune SMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )includes/Mailer/PhpMailerBuilder.php:241 -
Venmail SMTP and Lead FinderFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )venmail-smtp-and-lead-finder.php:46 -
Kaiizen Mail LogFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-mail-catcher.php:378 -
ByteCoreStackFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-bcs-smtp-mailer.php:162 -
MountDev Email Delivery for CloudflareFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-mailer.php:192 -
LettrFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )wp-mail.php:161 -
PostkeepFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )includes/smtp-manager/class-smtp-mailer.php:1330 -
Resonanz Email ReroutingFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )inc/email-rerouting.php:557 -
Silent Threads SecurityFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-wpmm-email-template.php:71 -
SMTP SenpaiFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )includes/class-smtp-senpai-mailer.php:467 -
TrackFormProFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/lead-email-source.php:150 -
NimblyMail SMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )src/Sandbox/SandboxInterceptor.php:455 -
MazeSMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', $content_type )app/Mail/MimeBuilder.php:168 -
meil.roFewer than 10 installs
apply_filters( 'wp_mail_content_type', $parsed['content_type'] )includes/class-meil-mailer.php:71 -
Sendfeather SMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-mailer.php:150 -
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 -
PureMailsFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/Design.php:70 -
GhostParseFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-mailer.php:40 -
FreexyaFewer than 10 installs
apply_filters( 'wp_mail_content_type', $type )modules/Mail/Transport.php:264 -
Letterkeep Contact FormFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/class-letterkeep-mailer.php:84 -
OG ConnectorsFewer than 10 installs
apply_filters( 'wp_mail_content_type', $out['type'] )backend/app/extensions/connectors/handlers/MailsHandler.php:65 -
Cybexsoft SMTPFewer than 10 installs
apply_filters( 'wp_mail_content_type', 'text/plain' )includes/mailers/class-mailer-base.php:371 -
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.