> ## Documentation Index
> Fetch the complete documentation index at: https://dub.co/llms.txt
> Use this file to discover all available pages before exploring further.

# How to set an expiration date for your Dub links?

> Learn how to use automatically expire your Dub links after a certain date & time.

<Tip>
  This feature is only available on [Pro plans and
  above](https://dub.co/pricing).
</Tip>

On Dub, you can set an expiration date for your links by clicking the **Expiration** button in the link builder. This will open a new modal called **Link Expiration**.

You can also quickly access the Link Expiration feature by using the keyboard shortcut `E` while in the link builder.

Enter the following fields to set the expiration:

1. **Date and Time**: Date and time when the link will expire.
2. **Expiration URL**: The URL that the user will be redirected to if the link expires.

Now click on the **Add expiration** button to set the expiration date and time for your link.

You can use natural language to set the date and time. For example, you can type "in 2 hours" or "tomorrow at 5PM" and Dub will automatically set the expiration date in the correct date-time format for you.

<Frame>
  <video src="https://assets.dub.co/help/link-expiration-input-demo.mp4" loop autoPlay muted playsInline />
</Frame>

Alternatively, you can also set the expiration date manually by selecting the date and time from the date-time picker.

If you set an expiration date for your link, the user will see an "Expired Link" page when they try to access the link after the expiration date ([example](https://dub.sh/expired)).

<Frame>
  <img src="https://assets.dub.co/cms/expired-link-placeholder.png" alt="Expired link page" />
</Frame>

<Warning>
  Note: All clicks to the link after the expiration date will ***not*** be
  tracked.
</Warning>

## Setting a custom expiration URL

You can also set a custom expiration URL for your links. This is useful if you want to redirect users to a specific page when the link expires.

To set a custom expiration URL, simply enter a custom URL in the **Expiration URL** field under the **Link Expiration** section.

<Frame>
  <img src="https://assets.dub.co/help/link-expiration-url.png" alt="Expired link page" />
</Frame>

## Setting a default expiration URL for all links under a domain

Alternatively, you can also set a default expiration URL for all links under a domain. This is useful if you want to redirect users to a specific page when *any link under the domain* expires.

Here's how you can set a default expiration URL for all links under a domain:

1. Go to the [Domains settings page](https://app.dub.co/domains) in your Dub dashboard.
2. Click on the `⋮` button of domain that you want to set the default expiration URL for, which will open a dropdown menu.

<Frame>
  <img src="https://assets.dub.co/help/domain-popover-menu.png" alt="More options popover" />
</Frame>

4. In the dropdown menu, select the **Edit Domain** option, which will open the Edit Domain modal.
5. Under the **Default Expiration URL** field, enter the URL that you want to redirect users to when any link under the domain expires.

<Frame>
  <img src="https://assets.dub.co/help/domain-expiration-url.png" alt="Default expiration URL for a domain" />
</Frame>

7. Click on the **Save changes** button to save the changes.
