# Trim link to domain name only

**URL:** <https://forum.bubble.io/t/trim-link-to-domain-name-only/214708>\
**Category:** Need help\
**Created:** [July 9, 2022, 6:14am UTC](https://forum.bubble.io/t/trim-link-to-domain-name-only/214708 "2022-07-09T06:14:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![artpnp01](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/artpnp01/32/134601_2.png) [@artpnp01](https://forum.bubble.io/u/artpnp01)\
**Post date:** [July 9, 2022, 6:14am UTC](https://forum.bubble.io/t/trim-link-to-domain-name-only/214708/1 "2022-07-09T06:14:03Z")

</div>

How can I get the url to be trimmed down to only the root domain name, like the screenshot shows.

At the same time, when I click on the highlighted domain name that has been cut, it will jump to the specific webpage.

 ![截屏2022-07-09 下午2.10.34](https://us1.discourse-cdn.com/bubble/original/3X/6/b/6b99c612fae482ba07d64e2b30b2d7a93739882b.png)  
 ![截屏2022-07-09 下午2.10.46](https://us1.discourse-cdn.com/bubble/original/3X/e/c/ecf67f0114d38112ae94647d9a058fa2eeebbc9e.png)

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [July 9, 2022, 7:28am UTC](https://forum.bubble.io/t/trim-link-to-domain-name-only/214708/2 "2022-07-09T07:28:59Z")

</div>

Hi there @artpnp01,

You should be able to use the :extract operator to extract the domain.

---

<div class="post-metadata">

**Author:** ![artpnp01](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/artpnp01/32/134601_2.png) [@artpnp01](https://forum.bubble.io/u/artpnp01)\
**Post date:** [July 9, 2022, 8:11am UTC](https://forum.bubble.io/t/trim-link-to-domain-name-only/214708/3 "2022-07-09T08:11:39Z")

</div>

thanks for your suggestion.  
If I use regex to extract the main domain name, when I click on the url, I will only go to the main domain name and cannot point to the real url.

I need it to look like this: [xxxx.com](http://xxxx.com)  
But the actual jump is:  
[xxxx.com/xaxadsad/dasdas](http://xxxx.com/xaxadsad/dasdas)

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [July 9, 2022, 10:15am UTC](https://forum.bubble.io/t/trim-link-to-domain-name-only/214708/4 "2022-07-09T10:15:36Z")

</div>

Use the link element?

---

<div class="post-metadata">

**Author:** ![artpnp01](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/artpnp01/32/134601_2.png) [@artpnp01](https://forum.bubble.io/u/artpnp01)\
**Post date:** [July 9, 2022, 10:24am UTC](https://forum.bubble.io/t/trim-link-to-domain-name-only/214708/5 "2022-07-09T10:24:44Z")

</div>

It is a way, but link element can’t be put into text element, I still wanna show the link in text element.

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [July 9, 2022, 3:02pm UTC](https://forum.bubble.io/t/trim-link-to-domain-name-only/214708/6 "2022-07-09T15:02:30Z")

</div>

Use `This url:split by / #item number`

Before you split find and replace https:// or http:// with nothing.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [September 17, 2022, 6:14am UTC](https://forum.bubble.io/t/trim-link-to-domain-name-only/214708/7 "2022-09-17T06:14:23Z")

</div>

Closed on September 17, 2022, 6:14am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
