Change Link Target

Easily change link target attributes in HTML. Convert links to _self, _blank, _parent, or _top, optionally filter by URL, and optionally add rel attributes like noopener noreferrer.

Or paste HTML manually below.
Space-separated rel tokens. Existing rel tokens are preserved and deduplicated.

No links processed yet.

Change Link Target - Explanation & Examples

The Change Link Target tool lets you quickly update link target attributes in HTML. Convert links to _self, _blank, _parent, or _top, apply optional URL filtering, and optionally add a rel attribute in one pass.


⭐ What this tool does

  • Finds all <a href> links in your HTML
  • Lets you choose which current target value should be replaced (_self, _blank, _parent, _top, no target, or all)
  • Changes target attributes to _self, _blank, _parent, _top, or a custom target value
  • Optionally filters links by URL text
  • Optionally updates only links that already have a target attribute
  • Optionally adds rel values like noopener noreferrer
  • Preserves other attributes and content
  • Shows total, checked, and modified link counts
  • Lets you copy or download the updated HTML

🔎 How to use

  1. Paste your HTML or upload an HTML file.
  2. Choose which current target value you want to replace (or choose custom and type your own source target).
  3. Choose the new target value (or choose custom and type your own destination target).
  4. Optionally set a URL filter to update only matching links.
  5. Optionally enable "Only update links that already have a target attribute".
  6. Optionally enable automatic rel addition and set rel tokens.
  7. Click Convert to generate updated HTML.

⚙️ Example

Input:

<a href="/about">About</a>
<a href="https://example.com" target="_self">External</a>
<a href="https://example.com/blog" target="_blank" rel="nofollow">Blog</a>

Settings:
Current target to replace: _self
New target: _blank
URL contains: example.com
Only with existing target: Yes
Add rel automatically: noopener noreferrer

Output:

<a href="/about">About</a>
<a href="https://example.com" target="_blank" rel="noopener noreferrer">External</a>
<a href="https://example.com/blog" target="_blank" rel="nofollow noopener noreferrer">Blog</a>

⚠️ Notes

  • All processing runs in your browser. No data is uploaded.
  • When rel auto-add is enabled, existing rel tokens are preserved and deduplicated.
  • Malformed HTML can be normalized by browser parsing.
  • Use _blank with rel tokens like noopener noreferrer for safer external links.

Frequently Asked Questions

It updates the target attribute of links in HTML so you can quickly switch links to _self, _blank, _parent, or _top.

Yes. Select your target value and process your HTML to update all matching links in one action.

Yes. Choose a current target value to replace, such as only _self or only _blank. The tool then updates only links that match that source target value.

Yes. For both current target and new target, select Custom value and type your own string. The tool will replace only links that match your custom current value.

Yes. Use the optional URL filter to update only links whose href contains your text.

Yes. Enable the checkbox to skip links without an existing target attribute.

The tool supports _self, _blank, _parent, and _top.

Yes. Enable the rel option and provide rel tokens such as noopener noreferrer. Tokens are merged with existing rel values.

No. Existing rel values are preserved. New rel values are appended and duplicates are removed.

Yes. The tool only updates target and optional rel values. Other attributes remain unchanged.

Yes. Upload HTML or text files, process them in your browser, then copy or download the updated output.

No. Everything runs client-side in your browser for privacy.

Yes. You get counts for links found, checked, and modified after conversion.

Yes. It is suitable for large files, limited mainly by available browser memory.