Adding a Link to a Button in WordPress
A Button block without a committed URL still looks like a button but saves as an <a> with no href. Here is how the link control works, what it stores, and why buttons end up dead.
A button only links once the URL is committed with Enter (or the Submit/Apply control); close the popover before that and the button saves as an <a> with no href. It still looks like a button, it just goes nowhere.
What a Button block stores
The Button block (core/button) keeps its link in three attributes, all read from the saved <a> element:
| Attribute | Saved as | Set by |
|---|---|---|
url |
href |
The link field |
linkTarget |
target="_blank" |
Open in new tab |
rel |
rel |
Open in new tab adds noopener, Mark as nofollow adds nofollow; the Link relation field holds anything else |
When url is empty, the saved markup is <a class="wp-block-button__link wp-element-button">Book a call</a>: no href, so it is not focusable with the keyboard and does nothing when clicked. A button whose text is empty is worse: WordPress skips it entirely on the front end.
The surrounding Buttons block (core/buttons) is only a container. It has no link of its own and accepts nothing but Button blocks, so each button in a row carries its own URL. Duplicate a button to make a pair and the copy keeps the original link until you change it.
Add the link
- Insert a Buttons block. It starts with one Button inside; type the label where it says "Add text…".
- With the button selected, click Link in the block toolbar or press Ctrl+K (Cmd+K on a Mac).
- In the field ("Search or type URL"), paste a full address, or type the title of a page, post, category or media file and pick it from the suggestions.
- Press Enter, or click the Submit arrow at the end of the field.
The popover then switches to a preview of the destination with Edit link, Remove link and Copy link buttons, and the toolbar button changes to Unlink (Ctrl+Shift+K). If you still see an empty field when you reselect the button, the link was never applied.

Open in new tab and nofollow
These toggles do not appear while you add a brand-new link: the Advanced section only shows when you edit a link that already exists. So the order is:
- Add the URL and press Enter.
- In the preview, click Edit link.
- Expand Advanced and switch on Open in new tab and/or Mark as nofollow.
- Click Apply. Cancel discards the change.
Open in new tab sets target="_blank" and adds noopener to rel; turning it off removes both. For sponsored, ugc or anything else, select the button and type it into Link relation under Advanced in the block settings sidebar. Use space-separated values, and leave in place the ones the toggles added.
What the link field accepts
The editor decides how to treat what you type before saving it:
| You type | Stored as | Notes |
|---|---|---|
example.com/pricing |
https://example.com/pricing |
https:// is added automatically |
| A page title | That page's URL | Search covers pages, posts, terms and media |
#pricing |
#pricing |
Jumps to a block on the same page |
/contact/ |
/contact/ |
Relative paths are kept as typed |
tel:+441234567890 |
tel:+441234567890 |
Must include tel: and no spaces |
mailto:hello@example.com |
mailto:hello@example.com |
A bare address is rejected |
+44 1234 567890 |
Nothing | Treated as a search; Enter shows "Please enter a valid URL." |
Phone and email. The editor has no phone or email detection in the link field, so the prefix is required. Spaces make any entry invalid, which is why tel:+44 1234 567890 fails while tel:+441234567890 works. Visitors on desktop need a calling app for tel: links, so put the number in the button label too.
A section of the page. Select the destination block, open Advanced in its sidebar and fill in HTML anchor, for example pricing, without the #. The field turns spaces and # into hyphens. Then link the button to #pricing. From another page, use /pricing-page/#pricing.
A file. Type the file's title from the Media Library and choose it from the suggestions. The button links straight to the file URL, not the attachment page. Whether a PDF opens or downloads is up to the visitor's browser; the Button block has no download option.
A page that does not exist yet. If nothing matches, the suggestions offer Create page: your title, which creates a draft and links to it. Publish that page before the button goes live.
Why the link option is missing
- The HTML element was changed. Advanced › HTML element offers "Default (<a>)" and "<button>". With
<button>the Link toolbar control disappears and nohref,targetorrelis saved. That setting is for buttons inside forms or scripts; switch it back to get a link. - The Buttons wrapper is selected, not the Button. The wrapper has no Link control. Click the button text itself, or use the breadcrumb at the bottom of the editor.
- The URL is bound to a source. If a pattern or block binding controls the button's URL and you cannot edit that source, the link control is hidden. See synced patterns for how overrides work.
- The editor itself is failing. If no toolbar appears on any block, start with block editor not working.
Styling lives in two places: Fill or Outline, colours, border and width on the Button; alignment and the gap between buttons on Buttons. Spacing between blocks generally is covered in block spacing and layout.
Classic editor and page builders
The classic editor has no Button block; buttons there come from the theme or a shortcode, with the link as a shortcode parameter named in their documentation. If you stay on it on purpose, see restoring the classic editor. Page builders such as Elementor have a Button widget with a permanently visible link field, so the uncommitted-link problem does not arise there.
A row of many buttons is usually navigation; it belongs in a Navigation block, which handles menus and keyboard focus properly.
Verify
- Reselect the button: the popover shows a destination preview, not an empty field.
- On the front end, Tab to the button: it takes focus. Hover it: the browser shows the URL in the corner.
- In Code editor view, the button's
<a>has anhref, andtarget="_blank"only where you meant it. - Tap
tel:andmailto:buttons on a phone.
Frequently asked
- Select the button, press Ctrl+K (Cmd+K on a Mac) and type the number with the tel: prefix and no spaces, for example tel:+441234567890, then press Enter. Without tel: the editor treats the digits as a search term, and with spaces it rejects the entry as not a valid URL.
- Open the button's link field and start typing the page's title instead of pasting its address. The suggestions list searches your pages, posts, categories and media; pick the page and the button stores its current URL. If the page does not exist yet, the list offers to create a draft page with that title.
- Its url attribute is empty, so it was saved as an a element without href, which browsers do not treat as a link. Usually the URL was typed but the popover was closed before pressing Enter. Less often the button's HTML element was switched to <button> in the Advanced panel, which removes the link entirely.