Message filtering refers to the blocking of messages that are unwanted or illicit. Filtering may occur to enforce Twilio’s policies, or to comply with regulations and wireless carriers’ messaging policies.
This article is about steps and specific guidelines to reduce the risk of messages being filtered. For general information about message filtering, see How Does Message Filtering Work?
The best way to prevent your messages from being filtered is to follow the guidelines in Twilio’s Acceptable Use Policy and Messaging Policy, and avoid sending spam or fraudulent traffic. In addition, check Twilio’s SMS Guidelines for the country you are sending messages to. Twilio keeps these pages up to date with rules and best practices for each country.
Below are some guidelines that will greatly reduce the chances that your messages will be filtered.
Consent and Opt-In
- Ensure that you only send messages to mobile users who have provided consent (opted-in) to receive messages from you.
- Ensure that your messages clearly identify who is sending the message, and how to opt-out (for example, “Reply STOP to unsubscribe”). If you are contacting the same recipients multiple times per month, you do not need to provide opt-out instructions in every message, but you must do it at least once per month.
- If you are sending messages to users repeatedly over a long period of time, you should check in with your recipients at least once every 18 months to ensure they still want to receive messages from you. The mobile number you are sending messages to may have changed owners, or the recipient may not remember giving consent to receive messages from you.
- For certain use cases including job alerts, sweepstakes, and lead generation services, Twilio requires you receive double opt-in consent from recipients. You can read more about this in the Messaging Policy in the section “Double Opt-in Consent.”
Use Case and Sender Selection
- Check Twilio’s SMS Guidelines for the country you are sending messages to. Twilio keeps these pages up to date with best practices for each country.
- If you are sending application-to-person (A2P) traffic, the carriers in the country you are sending to may require that this traffic be sent from a short code (What is a short code?) or from a pre-registered Alphanumeric Sender ID, if available. These are both ways that carriers can review your messaging use case in advance, and offer better delivery as a result. In addition, some countries (such as France) have prohibitions against local numbers from that country being used for A2P traffic. In such cases, Alpha Sender ID (if available) or a number from a different country is a good solution for 1-way A2P messaging. If in doubt, check the SMS Guidelines page for the country in question.
- Do not send links that have been shortened using free public URL shorteners, such as goo.gl or bit.ly links. US carrier policies forbid the use of free public URL shorteners, due to the frequency of use by spammers.
- If you want to include shortened URLs in your messages, we recommend using a dedicated short domain that belongs to your business, or a URL shortener service which offers a unique non-shared domain for your URLs (this is a paid feature on some URL shortener services).
Avoid account takeover
If your Twilio Account SID and Auth Token accidentally fall into the wrong hands (for example, posted in public code on a site like Github), your account could be used to send bad messaging traffic. We strongly recommend you keep your Twilio account credentials safe to prevent account takeovers.
- For technical guidance on how to keep your credentials safe, see Store Your Twilio Credentials Securely (Twilio Docs).
- If you suspect your account has been compromised, please see Proactive Steps for Customers Experiencing Account Takeover.
I think my messages are being filtered by mistake. What can I do?
Twilio works hard to ensure that customers do not see filtering on legitimate messaging that follows all applicable rules. However, no automatic system is perfect. If you have reviewed the above information thoroughly, and you believe your messages are compliant with Twilio and carrier policies, please collect 3 or more examples of Message SIDs that have the “undelivered” status with error 30007, and then contact our Support team. We can help review your messaging and determine if an error was made, and put you in touch with our Compliance team if needed.
For more information on message filtering, see How Does Message Filtering Work?