---
title: "Autolink plugin"
description: "Automatically create hyperlinks."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/autolink/"
md_url: "https://www.tiny.cloud/docs/tinymce/6/autolink/index.md"
version: "6"
last_updated: "2022-11-30T01:26:11Z"
tokens: 502
---
Important This page documents TinyMCE 6. For new projects, Tiny recommends using the latest, most up-to-date version. [See TinyMCE 8 documentation](../../latest/autolink/).
# Autolink plugin

The Autolink plugin automatically creates hyperlinks when a user types a valid, complete URL. For example `www.example.com` is converted to `http://www.example.com`.

Note that this option won’t convert incomplete URLs. For example `example.com` would remain as unlinked text and URLs must include `www` to be automatically converted.

> **Note:** Pasted URLs are automatically converted to `a` elements by TinyMCE’s core code, not by the autolink plugin. Therefore, behaviour and settings described here do not apply to pasted links.

## Basic setup

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'autolink'
});
```

## Options

### `link_default_target`

This option allows you to set a default `target` value for links when inserting/editing a link via the link dialog. If the value of `link_default_target` matches a value specified by the [`link_target_list`](../link/#link_target_list) option, that item will be set as the default item for the targets dropdown in the link dialog.

> **Note:** This option also applies to the [link](../link/) plugin.
**Type:** `String`

#### Example: using `link_default_target`

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'link autolink',
  toolbar: 'link',
  link_default_target: '_blank'
});
```

### `link_default_protocol`

This option allows you to set a default protocol for links when inserting/editing a link via the link dialog. The protocol will apply to any links where the protocol has not been specified and the prefix prompt has been accepted.

> **Note:** This option also applies to the [link](../link/) plugin.
**Type:** `String`

**Default value:** `'https'`

#### Example: using `link_default_protocol`

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'link autolink',
  toolbar: 'link',
  link_default_protocol: 'http'
});
```
