# Auto-Linkify Words

**URL:** https://meta.discourse.org/t/auto-linkify-words/82193
**Category:** Theme component
**Tags:** official, linkify-words
**Created:** [March 5, 2018, 7:16am UTC](https://meta.discourse.org/t/auto-linkify-words/82193 "2018-03-05T07:16:06Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [March 5, 2018, 7:16am UTC](https://meta.discourse.org/t/auto-linkify-words/82193/1 "2018-03-05T07:16:06Z")

</div>

> ❗Discourse has a built-in feature called `Watched Words` which can [replicate most of the features](https://meta.discourse.org/t/watched-words-reference-guide/241735) of this theme component. Consider using that before installing this theme component.

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | **Auto-Linkify Words** allows you to automatically hyperlink certain words or patterns in your post with the desired destination URL. |
| 🛠 | **Repository Link** | [https://github.com/discourse/discourse-linkify-words](https://github.com/discourse/discourse-linkify-words) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

> [@](#):
>
> :discourse2: As this is an #official theme component maintained by the Discourse team, #Support, #Contribute > Bug, #Contribute > UX, and #Contribute > Feature requests can be made in the respective categories here on Meta, and tagged with the appropriate theme component tag. Click on a link below to get one started. 👍
> 
> [❓&nbsp; **Support**](https://meta.discourse.org/new-topic?category_id=6&tags=linkify-words "Ask for support on configuring and using Auto-Linkify Words") [🐛&nbsp; **Bug**](https://meta.discourse.org/new-topic?category_id=1&tags=linkify-words "A bug report means something is broken, preventing normal/typical use of the theme component") [👀&nbsp; **UX**](https://meta.discourse.org/new-topic?category_id=9&tags=linkify-words "Discussion about the user interface of Auto-Linkify Words, and how features are presented (including language and UI elements)") [💡&nbsp; **Feature**](https://meta.discourse.org/new-topic?category_id=2&tags=linkify-words "Discussion about how existing Auto-Linkify Words features can be improved or enhanced, and how proposed new features could work")

### Features

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/4/b/54bebf2d9409c89f98beaed5d8c18ef52040c0ee.png)

### How to configure?

Configure the theme settings with the format

`WORD, https://destination.url.com`

or using regular expressions (in [JavaScript implementation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)) with the format

`/regex/, https://destination.url.com`

One item per line

 ![theme_settings](https://global.discourse-cdn.com/meta/original/3X/f/a/faca3963ba4a7516483bb41a8b48e727ee60ab3d.png)

### Using regular expressions

With regular expressions, you can match a certain pattern to a single URL. This is useful for synonyms or for words which can take different forms in the sentence etc.

However, you can also generate the URL automatically based on what was matched. For example, let’s say you have a line of products, each with its own numeric id, and you want to autolink them to their own URLs. Using

`/product-([0-9]+)/, https://myshop.com/product/$1`

`product-42` will be autolinked to `https://myshop.com/product/42`  
Notice the capturing parentheses in the regular expression and the `$1` in the URL which is substituted by the match inside the parenthesis. You can also capture multiple parts of the string and use `$2`, `$3` and so on.

Regular expressions are by default case sensitive (unlike WORD’s which are case insensitive). However, you can change that by using a standard “i” modfier like this:

```
/foo/i, https://example.com

```

In this case, FOO, Foo or foo will all be matched.

### How this looks in action?

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/d/cdfc07953a5ac569429a10a9fcdbc6ae897bd238.png)

### Limitations

- Replacement will only appear in the web UI and will not appear in emails.

### Settings

| Name | Description |
| --- | --- |
| linked words | |
| excluded tags | |
| excluded classes | |

### Credits

Big thanks to @Osama for building theme settings and [https://stackoverflow.com/questions/8949445/javascript-bookmarklet-to-replace-text-with-a-link](https://stackoverflow.com/questions/8949445/javascript-bookmarklet-to-replace-text-with-a-link) for guiding on the implementation.

  

> :discourse2: **Hosted by us?** Theme components are available to use on our Standard, Business, and Enterprise plans.

> Last edited by @JammyDodger 2024-06-13T12:57:47Z
> 
> > **Check document**
> >
> > Perform check on document:

---

_[View the full topic](https://meta.discourse.org/t/auto-linkify-words/82193)._
