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:

  1. The document — stored in your file tree (dashboard), accessible to you at all times
  2. 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.

DurationAvailable
1 hourYes
4 hoursYes
1 dayYes
3 daysYes
7 daysYes
30 daysNo
90 daysNo
1 yearNo
ForeverNo

Free (registered account)

Free accounts can set expiry up to 30 days.

DurationAvailable
1 hourYes
4 hoursYes
1 dayYes
3 daysYes
7 daysYes
30 daysYes
90 daysNo
1 yearNo
ForeverNo

Pro ($5/mo or $50/yr)

Pro accounts have access to all durations, including Forever — the link never expires.

DurationAvailable
1 hourYes
4 hoursYes
1 dayYes
3 daysYes
7 daysYes
30 daysYes
90 daysYes
1 yearYes
ForeverYes

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
To set a password, click Advanced options when publishing a paste, then enter a password in the Password field.

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:
VisibilityPublic linkSearch / sitemapOn your profileTypical use
PublicYesYesYesDefault. Shareable and discoverable.
UnlistedYesNoNoLink-only — hand out the URL to specific people.
PrivateNoNoNoSaved to your dashboard with no public link.
Public pastes receive the default indexing behavior (canonical URL, included in the sitemap). Unlisted pastes get a 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.
Where you see aggregated data:
  • 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:
  1. Open the document in the editor
  2. Click the Share icon in the toolbar
  3. Enter the username or email address of the person you want to share with
  4. Click Add
Shared documents appear in the recipient's dashboard under a Shared with me section. The recipient can read the document, but cannot edit it or republish it.

Paste Size Limits

The maximum paste size depends on your tier:
TierMax size
Anonymous1 MB
Free1 MB
Pro5 MB
Pastes that exceed the limit are rejected with a 413 error. For very large files, consider hosting them as a repository and linking to them in a CodeThis paste.

Document Count Limits

Free accounts can store up to 100 documents in their file tree. Pro accounts have no limit.Once you hit the limit, you can delete old pastes to make room, or upgrade to Pro for unlimited storage.