By Vikas Bajaj, Attorney at Law · Last reviewed: November 1, 2026
Social media has changed how people communicate and share opinions. For many, it is an unfiltered place to post thoughts and personal experiences. But posts, comments, direct messages and videos can carry legal consequences that people often overlook. From the point of view of a criminal defense lawyer who has practiced in California since 2001, what you say online can affect an investigation or a pending case in ways that are hard to undo.
Here are 10 legal consequences to keep in mind when online speech and the law meet.
1. Your posts can be used as evidence against you
Anything you post can be collected, screenshotted and offered in court. In California, a statement you made is generally not excluded by the hearsay rule when the prosecution offers it against you (Evidence Code section 1220). Federal courts follow a similar rule for a party’s own statements. Even a deleted post may survive in someone else’s screenshot or in the platform’s records.
2. Online threats can be charged as crimes
A threat does not have to be made in person. California’s criminal threats law, Penal Code section 422, expressly covers threats made by electronic communication device. It applies to a willful threat to commit a crime that will result in death or great bodily injury, made with the specific intent that it be taken as a threat, that causes the person threatened to be in sustained fear. It can be charged as a misdemeanor or a felony.
Threats sent across state lines, which includes most messages over the internet, can also be charged federally under 18 U.S.C. § 875(c), with up to five years in prison. Using electronic communication in a course of conduct meant to harass or intimidate someone can be charged as federal cyberstalking under 18 U.S.C. § 2261A(2). See our federal criminal defense page for more on how federal cases differ.
3. Posting someone’s personal information can be a crime
Privacy matters online. Under Penal Code section 653.2, it is a misdemeanor to electronically distribute or post someone’s personal identifying information or an electronic message about them, without consent and with intent to place them in reasonable fear for their safety, for the purpose of getting others to harass or injure them. The penalty is up to one year in county jail, a fine of up to $1,000, or both.
4. Impersonating someone online
Creating a fake profile or posting as another real person can lead to charges. Penal Code section 528.5 makes it a crime to knowingly and without consent credibly impersonate another actual person online to harm, intimidate, threaten or defraud. Using another person’s identifying information for an unlawful purpose can also be charged as identity theft under Penal Code section 530.5. Read about computer fraud and cybercrime defense.
5. Defamation is usually a civil problem, but it still matters
False statements of fact that damage someone’s reputation can lead to a civil defamation lawsuit. In a criminal case, posts that attack an alleged victim or a witness can also become evidence of motive or bias, and can complicate negotiations. Do not post about the people involved in your case.
6. Contacting a witness or alleged victim online
Trying to influence a witness through social media is a serious risk. Under Penal Code section 136.1, knowingly and maliciously preventing or trying to dissuade a witness or victim from testifying, or from reporting a crime, is punishable by up to one year in county jail or by state prison. If the attempt involves force, threats or payment, it is a felony with a prison term of two, three or four years. A message does not have to succeed to be charged, and the law says it is no defense that no one was actually intimidated.
7. Violating a protective order or release conditions
Courts often issue protective orders or no-contact conditions in criminal cases. Willfully disobeying a lawful court order is contempt under Penal Code section 166(a)(4), and violations of certain criminal protective orders are separately punishable under section 166(c). A “like,” tag, comment or direct message to a protected person can be treated as contact. Ask your lawyer exactly what an order covers before you post anything. Our restraining order guide also covers restraining order violations.
8. Accounts and messages can be obtained by subpoena or warrant
Platforms receive legal process from investigators all the time. Prosecutors may seek account records and content with search warrants, court orders or subpoenas. Deleting posts or accounts after you learn of an investigation can create new problems: destroying records to keep them from an official proceeding can be charged as obstruction under 18 U.S.C. § 1512(c). Talk to a lawyer before changing or deleting anything.
9. Statements about your case and attorney-client privilege
Discussing your case online can waive the confidentiality of what you discussed with your lawyer and can contradict defenses you may raise later. Public comments about the case can also be used to argue that you admitted facts. Keep conversations about your case between you and your lawyer.
10. Law enforcement watches social media
Police and federal agents monitor public posts and may create accounts to view content. Information you share publicly can be used to open an investigation or to support a search warrant. If you think you may be under investigation, read how to know if you are under investigation and avoid posting about it.
A simple rule while a case is open
If you are under investigation or have a pending case, the safest approach is usually to stop posting about the case, the people involved and the events at issue. Do not delete anything without legal advice. Keep any messages you receive. Tell your lawyer about accounts you control, because your own posts may be offered as evidence.
Be careful with private groups and direct messages too. Anyone who receives a message can share it, and a friend or group member may later be interviewed as a witness. Settings that limit who can see a post do not stop that person from showing it to police or prosecutors. The same caution applies to family members who post on your behalf: their comments about the case can draw attention to it and can be used in ways no one intended.
Talk with Vikas Bajaj
If you have been charged with a crime or you are worried about something posted online, talk with a lawyer before you post, reply or delete anything. Contact the Law Office of Vikas Bajaj, APC to schedule a consultation.
This article provides general information about the law and is not legal advice. Reading it does not create an attorney-client relationship. Every case depends on its own facts, so consult a lawyer about your specific situation.
info@bajajlaw.com
(619) 525-7005