🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 26, 2026

How to Create a Short Link From Every Gravity Forms Entry

GravityExtra
How to Create a Short Link From Every Gravity Forms Entry

Long URLs are everywhere in a form workflow: a thank-you page with the entry id, a pre-filled download, a tracked campaign landing page. They are ugly in a text message, they break across lines in an email, and they are useless on a printed flyer or a QR code. A short link fixes all of that, and it gives you click tracking as a bonus. The problem is that making one by hand for every submission does not scale. This tutorial shows how to create a short link automatically from every Gravity Forms entry, using the Gravity Forms Short Links Premium Add-on, with Bitly, Rebrandly, Dub, or your own Pretty Links domain.

What you will build

By the end you will have a Gravity Forms feed that, the moment a form is submitted, builds a long URL from the entry, sends it to the short-link service of your choice, receives a short URL back, writes it onto the entry, and makes it available as a merge tag you can drop into a confirmation or a notification. The visitor never waits for the service, the work happens in the background, and a short link is never created twice for the same entry.

Before you start

You need Gravity Forms 2.5 or newer and the Short Links add-on installed and licensed; the setup guide in the documentation walks through installation and every setting in detail. You also need an account with the provider you want to use. Bitly, Rebrandly and Dub each give you an API key or token in their dashboard; Pretty Links is a WordPress plugin you install on your own site, so it needs no key. Pick one provider to begin with. You can change it later without rebuilding anything, because the provider is a single switch.

Step 1: Connect your provider

Go to Forms, then Settings, then Short Links. Activate your licence key if you have not already. Then set the Default provider and enter the key for it. If you chose Bitly, paste your Bitly access token. For Rebrandly, paste the API key from its API settings. For Dub, paste a workspace API key. Each key box is write-only: once you save, the key is encrypted and never shown again, which is exactly what you want on a shared site. If you have a branded short domain, such as go.yourbrand.com, add it in the matching domain box. Save, then press Check the connection. The add-on reads your account to confirm the key works, and it creates nothing while doing so. If you chose Pretty Links, there is no key to enter; the status line simply tells you whether the Pretty Links plugin is active.

Step 2: Decide what URL to shorten

A short link is only as useful as the URL behind it. Think about what you want the visitor, or your team, to land on. A common choice is a thank-you page that carries the entry id, so you can tie a click back to a submission, for example a page at yourbrand.com/thanks with a query string that includes the entry id. Another common choice is a Website field on the form itself: if the visitor typed a URL, you can shorten exactly what they entered. Gravity Forms merge tags let you build either one. Keep the URL on your own domain where you can, so your short link points at content you control.

Step 3: Add the feed

Open the form you want to work with, go to Settings, then Short Links, and add a new feed. Give it a name you will recognise later. Leave the Provider on the default, or override it for this one feed. In the URL to shorten box, type the long URL and use merge tags to build it. For a thank-you page you might write https colon slash slash yourbrand dot com slash thanks with a query string that ends in ref equals the entry id merge tag. The box must end up as a full http or https address once the merge tags are replaced; the add-on validates this and refuses anything that is not a real URL, so a blank field or a stray piece of text will never be sent to the provider.

If your provider supports it, set a Custom back-half, such as order followed by the entry id, to make the link readable. Rebrandly and Dub honour the back-half; Bitly does not offer it over its API, so it is ignored there. If you use a branded domain only for this feed, set it in the branded domain box. Finally, pick the field in Write the short link to, so the finished short URL is saved onto the entry. A hidden field is perfect for this, because it keeps the short link with the record without showing it on the form.

Step 4: Show the short link to people

The add-on registers merge tags you can use anywhere Gravity Forms replaces them. The main one is the short link tag, which outputs the short URL. There are also tags for the id the provider returned, the status of the creation, and the name of the provider that made the link. Because the link is created in the background, a fraction of a second after the form is submitted, you should show it on something that runs after that work finishes rather than on the raw submission.

The cleanest way is to add a notification that fires on the add-on’s own event. On a form that has a feed, two new events appear when you add a notification: one for when the short link was created, and one for when it could not be created. Choose the created event for a notification that includes the short link, and your team, or the visitor, receives the finished short URL instead of a long one. The failed event is handy for an internal alert, so you hear about a problem without checking entries by hand.

Step 5: Test it

Submit a test entry. Open it in the entry list and look at the Short Links box: you should see the provider, the created short link, its id and the status. Open the link in a new tab to confirm it redirects to your long URL. Check the field you chose for write-back; the short URL should be stored there. If you added a notification on the created event, check that it arrived with the link filled in.

How the background work keeps you safe

Creating a short link involves a call to an outside service, and outside services sometimes time out or fail. The add-on is built so that these failures never cost you a duplicate link or a stuck form. The visitor only ever waits for the normal confirmation. Behind the scenes, when an entry is saved, each matching feed is queued and a background job calls the provider. If the service cannot be reached before anything was sent, such as a DNS failure, the add-on retries later with a growing delay. If a request might already have arrived but the answer was lost, such as a timeout or a server error, the add-on marks the result as unsure and never repeats it automatically, because repeating it could create a second link. The entry note records exactly what happened, so you always know whether to wait, retry, or look in your provider dashboard.

Creating or recreating links in bulk

Sometimes you want to create links for entries that came in before you set up the feed, or you want fresh links for a new campaign. The entry list has two bulk actions for this. One creates short links only for entries that do not have one yet, so it is safe to run on a whole page of entries. The other forces a brand-new link even for entries that already have one. Both run in the background in small batches, so selecting hundreds of entries never slows the admin.

Going further with hooks

Developers can shape the behaviour with three hooks. A filter runs just before each link is made and receives the provider, the URL, the slug, the domain and the target field; you can change any of them, for example to append campaign parameters to the long URL, or return a non-array to skip the link for that entry. An action fires after a link is created, with the result, so you can push the short URL to another system. A second action fires when a link could not be created, with the reason, so you can log or alert. Together these make the add-on a building block in a larger automation rather than a closed box.

Keeping keys and data private

The URL built from the form is sent only to the provider you chose, over that provider’s own host, and nowhere else. The keys for the three cloud providers are stored encrypted with your site salts, so a copied database on its own cannot read them, and each key is locked to a single host so it can never be sent to another address. If you prefer that nothing leaves your site at all, use Pretty Links: the short link is created on your own WordPress domain and no outside call is made. Whichever route you take, the short link and its id are stored with the entry, and you should mention your chosen provider in your privacy policy.

Wrapping up

With a provider connected and a single feed in place, every submission to your form now produces a clean, trackable short link, written onto the entry and ready to drop into a message with a merge tag. You keep the links in your own account, the form stays fast, and you never have to shorten a URL by hand again. Start with one provider and one form, confirm it works end to end, and then roll the same pattern out across your site.

Ready to add automatic short links to your forms? Get the Gravity Forms Short Links Premium Add-on and have your first short link creating itself in minutes.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr