Sharing & Expiration
Share code with expiration, password protection, and public or private visibility. Control who can see your pastes and for how long.
How Sharing Works
When you publish a paste on CodeThis, two things are created:
- The document — stored in your file tree (dashboard), accessible to you at all times
- A public slug — a short random ID (e.g.,
abc12345) that makes the document accessible at/doc/abc12345
The expiry lives on the slug, not the document. When a slug expires, it's soft-deleted and the link stops working — but your document is still in your dashboard. You can republish at any time to create a new slug with a fresh expiry.
This means you never lose your content — you just lose public access to it when a slug expires.
Expiration Tiers
The expiry options available to you depend on your account tier:
Anonymous (no account)
Anonymous pastes always expire after 7 days. There is no option to extend this. To get longer expiry, create a free account.
| Duration | Available |
|---|---|
| 1 hour | Yes |
| 4 hours | Yes |
| 1 day | Yes |
| 3 days | Yes |
| 7 days | Yes |
| 30 days | No |
| 90 days | No |
| 1 year | No |
| Forever | No |
Free (registered account)
Free accounts can set expiry up to 30 days.
| Duration | Available |
|---|---|
| 1 hour | Yes |
| 4 hours | Yes |
| 1 day | Yes |
| 3 days | Yes |
| 7 days | Yes |
| 30 days | Yes |
| 90 days | No |
| 1 year | No |
| Forever | No |
Pro ($5/mo or $50/yr)
Pro accounts have access to all durations, including Forever — the link never expires.
| Duration | Available |
|---|---|
| 1 hour | Yes |
| 4 hours | Yes |
| 1 day | Yes |
| 3 days | Yes |
| 7 days | Yes |
| 30 days | Yes |
| 90 days | Yes |
| 1 year | Yes |
| Forever | Yes |
Expired Slugs
When a slug expires:
- The
/doc/[slug]URL returns a 404 - The slug is soft-deleted in the database
- Your document is not deleted — it remains in your dashboard
To make the document public again, open it in the editor and click Share to generate a new slug. You can choose a new expiry duration at this point.
Republishing a Document
Every time you click Share from the editor, a new slug is created. Old slugs for the same document are not affected — they remain valid until they expire.
This means you can share the same document multiple times with different expiry dates and different audiences. Each share generates a unique URL.
Password Protection
ProPro users can set a password on a paste. Password-protected pastes:- Show a password prompt when someone visits
/doc/[slug] - Are never indexed by search engines (regardless of visibility)
- Can only be fetched via the API if you authenticate with your own API key
Password-protected pastes are not encrypted at rest — the password gates access, but the content is stored as plaintext in the database. Do not use CodeThis to store highly sensitive secrets.
Visibility
Every paste has one of three visibility states, set when you create it and changeable at any time from the Sharing & Settings modal:| Visibility | Public link | Search / sitemap | On your profile | Typical use |
|---|---|---|---|---|
| Public | Yes | Yes | Yes | Default. Shareable and discoverable. |
| Unlisted | Yes | No | No | Link-only — hand out the URL to specific people. |
| Private | No | No | No | Saved to your dashboard with no public link. |
noindex meta tag and are excluded from both the sitemap and your public profile. Private pastes never leave your account.Anonymous pastes cannot be private — there would be no way to retrieve them without a public link. Anonymous choices are clamped to Unlisted at most.View Counts
Every Public and Unlisted paste shows a view count next to the created date on/doc/[slug]. The count is visible to everyone — the author, the visitors, anonymous traffic — so it doubles as a lightweight social signal on popular docs.What counts as a view:- One unique visitor (deduped by IP) in a 30-minute rolling window.
- Hitting refresh in the same tab doesn't bump the number.
- Opening in an incognito window does bump it (different IP fingerprint after the window resets).
- The author's own visits count the same as anyone else's — there's no owner-bypass.
- The dashboard shows your total views across all docs, a top-docs-by-views donut chart, and the top 8 most-viewed files with direct links.
- Pro users get a 30-day area chart of views over time.
- Private pastes never accumulate views — no public link, nothing to track.
Sharing with Other Users
Registered users can share documents directly with other CodeThis users. Shared users get read-only access to the document in their own dashboard.To share a document:- Open the document in the editor
- Click the Share icon in the toolbar
- Enter the username or email address of the person you want to share with
- Click Add
Paste Size Limits
The maximum paste size depends on your tier:| Tier | Max size |
|---|---|
| Anonymous | 1 MB |
| Free | 1 MB |
| Pro | 5 MB |
413 error. For very large files, consider hosting them as a repository and linking to them in a CodeThis paste.