Feature Announcement
Link Expiration
Set automatic expiration times for snippets. Control snippet lifetime with flexible TTL options.
Not all code snippets need to live forever. Demo code, temporary examples, time-sensitive previews — these have a natural expiration date.
Link expiration for pastecn snippets lets you automatically clean up content after a specified time, keeping your shared links relevant and reducing digital clutter.
How it works
Choose expiration time
When creating a snippet, select an expiration option from the dropdown. Choose from 1 hour, 24 hours, 7 days, 30 days, or never expire.
Create and share
Create your snippet as usual. The expiration timer starts immediately. Share the URL with your audience knowing it will automatically clean up when the time comes.
Automatic cleanup
When the expiration time arrives, the snippet becomes inaccessible. No manual deletion, no leftover links — the system handles cleanup automatically.
Expiration options
Choose the lifetime that matches your use case. All times are measured from the moment of creation.
Perfect for quick code reviews, live debugging sessions, or temporary examples during meetings.
Ideal for daily standup examples, code samples in chat discussions, or next-day follow-ups.
Great for sprint-related code, weekly demos, or short-term collaboration with clients.
Suitable for monthly reports, extended project phases, or content with medium-term relevance.
The default option. Snippets remain accessible indefinitely for documentation, tutorials, or permanent references.
Expiration visibility
Snippets with expiration times display a countdown timer on their preview page. Viewers can see exactly when the content will become unavailable, helping them decide whether to install immediately or save the code locally.
Time-limited snippet
This snippet will automatically expire on February 6, 2026 at 11:30 PM UTC. Install now or save the code if you need it later.
Use cases
Demo code. Share examples during presentations that automatically clean up afterward.
Code review snippets. Share code fragments for quick feedback without permanent storage.
Time-sensitive previews. Share beta features or experimental code that has a limited testing window.
Temporary client work. Deliver code samples for project phases that won't need long-term access.
Privacy-conscious sharing. Minimize data retention by automatically removing snippets when no longer needed.
Combine with password protection
Link expiration works seamlessly with password protection. Create time-limited, password-protected snippets for maximum control over both access and lifetime.
Double-layered security
Protect sensitive code with a password and set an expiration time to ensure it disappears after your project concludes. Perfect for client deliverables or contractor work with defined end dates.
Technical details
Expiration is enforced at read time. When accessing an expired snippet, the system checks the expiration timestamp and returns a 404 Not Found response if the deadline has passed.
Timestamp-based expiration
Expiration times are stored as ISO 8601 timestamps in the snippet metadata. The system compares the current time against this timestamp on every access.
Immediate enforcement
Expiration checks happen in real-time. The moment a snippet expires, it becomes inaccessible. No delays, no grace periods.
HTTP 404 Not Found status
Expired snippets return a 404 Not Found status code, indicating that the resource is no longer available.
Optional feature
Link expiration is completely optional. The default setting is "never expire" — existing snippets remain permanent, and new snippets default to permanent storage unless you explicitly choose an expiration time.
You control the lifecycle of every snippet you create. Set expiration when you need it, skip it when you don't.