A code of conduct is the document that tells members how to treat each other and what happens when someone does not. It is different from a casual set of rules because it also explains scope, reporting and enforcement. A good one prevents arguments before they begin, protects moderators from accusations of bias and makes newcomers feel safe. A poor one gets ignored or, worse, applied unevenly. Here is how to write one that works.
Code of conduct or guidelines?
The terms overlap, but there is a useful distinction. Guidelines describe the culture and give practical tips for posting. A code of conduct is more formal, covering unacceptable behaviour, reporting channels and consequences. Many communities use both. If you have not written guidelines, start with our guidelines template, then add a code for the harder situations.
Start with purpose and scope
Open with a short statement of why the code exists and what kind of space you want to maintain. Then define where it applies: public threads, private messages between members, events, linked chats and any official off-platform spaces. Be explicit about who it covers, including moderators and founders. A code that exempts leadership loses credibility instantly.

Describe expected behaviour
State positives first. People respond better to a picture of what to do than to a wall of prohibitions. Typical expectations include:
- Treat others with respect, even in disagreement.
- Assume good faith and ask before accusing.
- Credit other people's work.
- Respect privacy and personal boundaries.
- Report problems rather than retaliating.
Keep each item short and concrete so it can be understood in seconds.
List unacceptable behaviour specifically
Vague bans like "no toxicity" invite endless debate. Name the behaviours:

- Harassment, threats and intimidation.
- Hate speech and slurs.
- Sharing private information without consent. See how to handle doxxing and privacy leaks.
- Sexual content or advances where unwelcome.
- Spam and deceptive self-promotion.
- Deliberate disruption of conversations.
You will never cover every case, so add a line explaining that moderators use judgment for situations not listed. For handling targeted abuse, read how to handle harassment in online communities.

Make reporting easy and safe
A code is only as good as the way people can report violations. Explain:
- Where to report: a form, a button or a named contact.
- What to include: links, screenshots and context.
- Who sees reports and how confidentiality is handled.
- How quickly members can expect a response.
- That retaliation against reporters is itself a violation.
Do not promise absolute secrecy unless you can guarantee it. Be honest about who will read what. For internal processes, see how to handle user reports fairly.
Spell out the consequences
People should know in advance what can happen. Describe a ladder of responses, for example reminder, warning, temporary mute, suspension and permanent ban. Make clear that severe violations may skip steps. Avoid rigid formulas that tie your hands, but promise proportionate, consistent responses. When bans are necessary, our guide on how to ban a member without starting a war helps you do it with dignity.
Provide an appeals path
Fairness requires a way to ask for review. Offer a simple appeal channel, say who will review it (ideally someone not involved in the original decision) and set a timeline. Not every appeal will succeed, but the existence of the process builds trust. See how to build a fair moderation appeals process.
Write in plain language
Legal-sounding text discourages reading. Use short sentences, everyday words and a warm but firm tone. Aim for a page or two. Add a brief summary at the top for people in a hurry. Test your draft by asking two or three members to explain it back to you. If they misread it, simplify.
Publish, pin and revisit
Put the code where nobody can miss it: at signup, pinned in the main board and linked in your welcome message. Ask newcomers to acknowledge it. Then review it once or twice a year, adding examples from real cases and removing rules nobody uses. Record major changes and announce them clearly, following how to write announcements people read.
The bottom line
A strong code of conduct is clear about purpose, specific about behaviour, honest about reporting, proportionate in consequences and fair through appeals. It protects members and moderators alike and gives you something steady to point to when emotions run high. Write it simply, apply it evenly and keep it alive through regular review.
Frequently asked questions
How long should a code of conduct be?
One to two pages is usually enough. Short documents are read more often and enforced more consistently.
Do small communities need a code of conduct?
Yes. Even a short version helps set expectations and protects you when a conflict arises.
Should moderators follow the code too?
Absolutely. Leaders who are exempt undermine trust. State clearly that the code applies to everyone.
Can I copy another community's code?
You can borrow structure and wording, but adapt it to your community's scope, tone and enforcement capacity.


Loading comments…