Share buttons
Highlight to share: letting readers share selected text
Quick answer
Highlight to share shows a small popover when a reader selects text, offering to share that quote with a link back to the page. It suits quotable writing and research; it annoys people who select text to read or copy. Make it keyboard accessible, keep it off form fields and code blocks, and never block normal copying.
How it works
A small script listens for a text selection inside the article. When the selection is a reasonable length, it shows a popover near it with share options. Clicking one opens the network's share dialog with the quoted text and the page address. The MashShare Select and Share add-on did this for WordPress, and its product page is one of the most linked addresses in this domain's history, which tells you readers and reviewers liked the idea.
When it is worth adding
- Essays, interviews and research with sentences people want to quote.
- Data posts where a single statistic is the shareable unit.
- Speeches and transcripts.
It adds little to recipes, product pages or tutorials, where readers select text to copy commands or ingredients. On those pages the popover gets in the way.
Setup that respects readers
Limit the scope
Attach the listener to the article body only, and ignore selections inside
pre,code, inputs and tables.Set a length window
Show the popover for selections between about 20 and 280 characters. Very short selections are accidental; very long ones do not fit a post.
Never interfere with copy
Do not change the clipboard or add attribution text to copied content. Readers notice and dislike it.
Make it keyboard friendly
Selecting with the keyboard should also show the popover, focus should not jump to it automatically, and Escape should close it.
Load it lazily
The script is small, but it only needs to load on article templates.
What gets shared
X accepts the quote as the post text plus the address. Facebook and LinkedIn ignore pre-filled text and use the page's preview tags, so for those networks the quote is only useful if you copy it for the reader to paste. That limitation is why many sites offer only X and copy in the popover.
Questions
Does highlight to share work with every network?
Only networks that accept pre-filled text, mainly X. Facebook and LinkedIn build the post from your page's preview tags.
Is highlight to share accessible?
It can be, if keyboard selection works, focus is not stolen, and the popover can be dismissed with Escape.
Will it stop people copying text?
It should not. Never modify the clipboard or block normal copying.
Hannah Voss, Editor. Checks every guide against a working WordPress install and the networks' current documentation. Last reviewed September 2026.
Related guides
- Click to tweet boxes: how to build them in WordPressBuild a click to tweet box in WordPress with a block or a simple link. Wording, the 280 character limit, how links are counted, and how to style the quote.3 min read
- Which share networks to show, and how manyHow to choose which social share buttons to display: match networks to your audience, keep the row short, and add copy link, email and messaging options.3 min read
- Share buttons and page speedWhy some share buttons slow WordPress pages and others cost almost nothing. How to measure the impact, and what to change to keep sharing fast on every page.3 min read