# Remove www. & .com

**URL:** <https://community.glideapps.com/t/remove-www-com/68574>\
**Category:** Ask for Help\
**Created:** [December 11, 2023, 12:07pm UTC](https://community.glideapps.com/t/remove-www-com/68574 "2023-12-11T12:07:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Si\_Gal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/si_gal/32/79433_2.png) [@Si\_Gal](https://community.glideapps.com/u/Si_Gal)\
**Post date:** [December 11, 2023, 12:07pm UTC](https://community.glideapps.com/t/remove-www-com/68574/1 "2023-12-11T12:07:28Z")

</div>

Hi, I am trying to remove the remove any text before the first “.” and after the second “.” so that [www.websitename.com](http://www.websitename.com) becomes websitename

Could someone help me as I couldn’t get it to work with a template function

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/c/2c43e3b67b7c8ccf1f54f9da5f345eb7f45760c9.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 11, 2023, 12:12pm UTC](https://community.glideapps.com/t/remove-www-com/68574/2 "2023-12-11T12:12:13Z")

</div>

Try the following in a JavaScript column:

```auto
return p1.split('.')[1];

```

Use the URL as a replacement for `p1`

---

<div class="post-metadata">

**Author:** ![Si\_Gal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/si_gal/32/79433_2.png) [@Si\_Gal](https://community.glideapps.com/u/Si_Gal)\
**Post date:** [December 11, 2023, 12:37pm UTC](https://community.glideapps.com/t/remove-www-com/68574/3 "2023-12-11T12:37:42Z")

</div>

That is great. the only issue is where the www. does not exist in the website. I was thinking of using an if-then-else to check for the www. existing and then another javascript colum that removes the characters after the first “.”

See the item second from bottom  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/2/e22360588c1f327697e5106f347453baf212ffca.png)

or do you have a better suggestion and if you think this would be best then could you help me with the javascript for this removal.

Thanks

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 11, 2023, 12:42pm UTC](https://community.glideapps.com/t/remove-www-com/68574/4 "2023-12-11T12:42:12Z")

</div>

```auto
return p1.match(/www/) ? p1.split('.')[1] : p1.split('.')[0];

```

But beware that if you’re likely to have other variations, the above might break in different ways.

---

<div class="post-metadata">

**Author:** ![Si\_Gal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/si_gal/32/79433_2.png) [@Si\_Gal](https://community.glideapps.com/u/Si_Gal)\
**Post date:** [December 11, 2023, 12:46pm UTC](https://community.glideapps.com/t/remove-www-com/68574/5 "2023-12-11T12:46:25Z")

</div>

understood but thank you for helping me for now.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [December 18, 2023, 12:47pm UTC](https://community.glideapps.com/t/remove-www-com/68574/6 "2023-12-18T12:47:18Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
