Paragraph Link Relations
WordPress plugin that adds a link relations option to inside paragraph blocks in the block editor.
by Jeremy Techtmann · github.com/removement/paragraph-link-relations
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/removement/paragraph-link-relations/archive/refs/heads/master.zipAdds an Additional link relations option to the link popup when you add or edit links inside paragraph blocks in the WordPress block editor. You can set custom rel values (e.g. sponsored, ugc) on inline links without touching code.
What it does
When you select text in a paragraph and add a link (or edit an existing link), the link popup includes an Advanced section. This plugin adds a fourth option there:
- Additional link relations — A checkbox that, when enabled, shows a text field. Whatever you enter is added to the link’s
relattribute (space-separated), in addition to any core options like “Open in new window” and “Mark as nofollow.”
Example: entering sponsored ugc produces <a href="..." rel="nofollow sponsored ugc"> if “Mark as nofollow” is also checked.
Requirements
- WordPress 5.0 or later (block editor)
- No other plugins required
Installation
- Ensure the plugin folder
paragraph-link-relationsis in yourwp-content/pluginsdirectory. - In WordPress Admin → Plugins, find Paragraph Link Relations and click Activate.
Usage
- Add or focus a Paragraph block.
- Select the text you want to turn into a link (or click an existing link).
- Use the link button in the toolbar (or Ctrl+K / Cmd+K).
- Enter or edit the URL as usual.
- In the Advanced section, check Additional link relations and type the rel values (e.g.
sponsored,ugc), separated by spaces. - Apply the link. The saved markup will include your custom
relvalues.
Unchecking Additional link relations clears the value and removes those rels from the link when you save.
How it works
The block editor’s inline link UI doesn’t expose a way to add custom fields. This plugin re-registers the core link format with an extended edit component that adds the “Additional link relations” setting and merges your input into the <a rel="..."> attribute when the link is saved.
By
This plugin was created by Jeremy Techtmann from removement
License
GPL v2 or later. See the main plugin file or gnu.org/licenses/gpl-2.0.html.