How to Let Readers Share Highlighted Text in WordPress: Free 1-Click Share My Exact Selection Card Plugin (2026 Guide & Download)
⚡ WordPress Growth & Viral Engagement

How to Let Readers Share Highlighted Text in WordPress: Free 1-Click Share My Exact Selection Card Plugin

Turn every standout sentence in your blog posts into a high-converting social quote card and attribution link. Zero jQuery, zero external tracking scripts, and under 12KB total.

📅 Updated: November 2026 ⏱️ 5 Min Read 🧩 Single-File Plugin (v1.0.1) ✅ WordPress 6.x Ready

Think about how people actually read great articles online. They rarely share an entire 2,000-word post from top to bottom. Instead, they stumble across one sharp insight, one memorable statistic, or one punchy sentence that resonates—and they want to share that exact thought with their network.

Yet on 99% of WordPress websites, highlighting a sentence does nothing. If a reader copies the text manually, they lose your article title, your domain attribution, and the visual appeal that stops people from scrolling on X (Twitter), LinkedIn, WhatsApp, or Instagram Stories.

That is why we built the 1-Click “Share My Exact Selection / Highlight” Card plugin—built on the philosophy of genius in simplicity. No bloated dashboards, no third-party SaaS subscriptions, and zero impact on your Core Web Vitals.

✨ Live Interactive Demo — Try It Right Now!

Highlight any part of the text inside the box below with your mouse or finger to see the floating action toolbar in action:

“Simplicity is the ultimate competitive advantage in WordPress. When readers can turn a single highlighted sentence into a branded quote card in one click, every paragraph becomes a viral entry point back to your site.”

Why Traditional WordPress Social Share Plugins Fall Short

Most social sharing plugins on the WordPress repository were designed over a decade ago. They load heavy icon fonts, external tracking pixels, and floating sidebars that clutter mobile screens and hurt Lighthouse performance scores.

Feature Heavy Legacy Share Plugins 1-Click Highlight Card Plugin
Page Load Weight 150KB – 600KB+ (Multiple CSS/JS files) < 10KB (Inline Vanilla JS & CSS)
Reader Intent Generic full-page share buttons Context-aware exact quote selection
Attribution & Backlinks Basic URL only Formatted quote + Post Title + Direct Link
Visual Quote Card Paid add-on or unavailable Built-in instant PNG/Card generator
Privacy & GDPR Third-party cookies & tracking 100% local browser execution

Key Features Built Into This Single-File Plugin

🎯

Smart Selection Popover

Automatically detects when a reader highlights 8 to 420 characters and floats a clean toolbar with safe viewport positioning.

📋

1-Click Copy with Credit

Copies the exact selected quote wrapped in quotation marks alongside your article title and clickable source URL.

🖼️

Instant Quote Card Generator

Generates a clean, high-resolution downloadable quote card image using HTML5 Canvas—ready for LinkedIn, X, or Instagram Stories.

⚡

Block-Theme Friendly

Hooks into wp_footer and supports both mouse and touch selection across modern WordPress themes.

Download the Complete WordPress Plugin (Free)

Get the ready-to-install share-exact-selection-card.php file right now. Upload it directly to your WordPress site or test it locally in 60 seconds.

Full Open-Source Plugin Code

Want to inspect the code before installing? Here is the complete, self-contained WordPress plugin. Every line is clean, secure, and follows WordPress coding standards:

share-exact-selection-card.php
<?php
/**
 * Plugin Name: 1-Click Share My Exact Selection Card
 * Plugin URI:  https://smartchoicelinks.com/
 * Description: Lets readers highlight any text and copy a quote with link, share to X, or generate a quote card image.
 * Version:     1.0.1
 * Author:      WP Craft & Tools
 * License:     GPLv2 or later
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Share_Exact_Selection_Card_Fix {

	public function __construct() {
		add_action( 'wp_footer', array( $this, 'render_ui' ), 99 );
	}

	public function render_ui() {
		$post_title = wp_strip_all_tags( get_the_title() );
		$post_url   = is_singular() ? get_permalink() : home_url( add_query_arg( array(), $GLOBALS['wp']->request ) );
		$site_name  = get_bloginfo( 'name' );
		?>
		<style>
			#sesc-popover {
				position: absolute;
				display: none;
				background: #0f172a;
				color: #ffffff;
				padding: 7px 10px;
				border-radius: 10px;
				box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
				z-index: 999999;
				gap: 6px;
				align-items: center;
				font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
			}
			#sesc-popover button {
				background: rgba(255, 255, 255, 0.16);
				color: #ffffff;
				border: none;
				padding: 6px 10px;
				border-radius: 7px;
				font-size: 13px;
				font-weight: 600;
				cursor: pointer;
				line-height: 1.2;
			}
			#sesc-popover button:hover {
				background: #4f46e5;
			}
			#sesc-modal-backdrop {
				display: none;
				position: fixed;
				inset: 0;
				background: rgba(15, 23, 42, 0.72);
				z-index: 1000000;
				justify-content: center;
				align-items: center;
				padding: 20px;
			}
			#sesc-modal-box {
				background: #ffffff;
				border-radius: 16px;
				max-width: 500px;
				width: 100%;
				padding: 24px;
				text-align: center;
				box-shadow: 0 25px 50px rgba(0,0,0,0.35);
				font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
			}
			#sesc-canvas-preview {
				width: 100%;
				border-radius: 12px;
				margin: 14px 0;
				box-shadow: 0 8px 20px rgba(0,0,0,0.15);
			}
			.sesc-modal-actions {
				display: flex;
				gap: 10px;
				justify-content: center;
				flex-wrap: wrap;
			}
			.sesc-btn-primary {
				background: #4f46e5;
				color: #fff;
				border: none;
				padding: 10px 18px;
				border-radius: 8px;
				font-weight: 600;
				cursor: pointer;
			}
			.sesc-btn-secondary {
				background: #e2e8f0;
				color: #0f172a;
				border: none;
				padding: 10px 18px;
				border-radius: 8px;
				font-weight: 600;
				cursor: pointer;
			}
		</style>

		<div id="sesc-popover" role="toolbar" aria-label="Share selected text">
			<button type="button" id="sesc-copy-quote">📋 Copy Quote</button>
			<button type="button" id="sesc-share-x">𝕏 Post</button>
			<button type="button" id="sesc-make-card">🖼️ Quote Card</button>
		</div>

		<div id="sesc-modal-backdrop">
			<div id="sesc-modal-box">
				<h3 style="margin:0 0 6px;color:#0f172a;font-size:18px;">Your Shareable Quote Card</h3>
				<p style="margin:0;color:#475569;font-size:14px;">Download this image to share on LinkedIn, X, or Stories.</p>
				<canvas id="sesc-canvas" width="1080" height="620" style="display:none;"></canvas>
				<img id="sesc-canvas-preview" alt="Generated Quote Card" />
				<div class="sesc-modal-actions">
					<button type="button" class="sesc-btn-primary" id="sesc-download-png">⬇️ Download PNG</button>
					<button type="button" class="sesc-btn-secondary" id="sesc-close-modal">Close</button>
				</div>
			</div>
		</div>

		<script>
		(function() {
			const popover = document.getElementById('sesc-popover');
			if (!popover) return;

			const postTitle = <?php echo wp_json_encode( $post_title ); ?>;
			const postUrl   = <?php echo wp_json_encode( $post_url ); ?>;
			const siteName  = <?php echo wp_json_encode( $site_name ); ?>;
			let selectedText = '';

			function hidePopover() {
				popover.style.display = 'none';
			}

			function handleSelection(e) {
				if (popover.contains(e.target)) return;
				setTimeout(function() {
					const sel = window.getSelection();
					const text = sel ? sel.toString().trim() : '';
					if (text.length >= 8 && text.length <= 420 && sel.rangeCount > 0) {
						selectedText = text;
						const range = sel.getRangeAt(0);
						const rect = range.getBoundingClientRect();
						popover.style.display = 'flex';

						let top = window.scrollY + rect.top - popover.offsetHeight - 10;
						if (top < window.scrollY + 36) {
							top = window.scrollY + rect.bottom + 10;
						}

						const left = Math.max(
							12,
							Math.min(
								window.innerWidth - popover.offsetWidth - 12,
								window.scrollX + rect.left + (rect.width / 2) - (popover.offsetWidth / 2)
							)
						);

						popover.style.top = top + 'px';
						popover.style.left = left + 'px';
					} else {
						hidePopover();
					}
				}, 15);
			}

			document.addEventListener('mouseup', handleSelection);
			document.addEventListener('touchend', handleSelection);

			document.getElementById('sesc-copy-quote').addEventListener('click', function() {
				const formatted = '"' + selectedText + '"\n— ' + postTitle + ' (' + postUrl + ')';
				navigator.clipboard.writeText(formatted).then(() => {
					this.textContent = '✅ Copied!';
					setTimeout(() => { this.textContent = '📋 Copy Quote'; hidePopover(); }, 1200);
				});
			});

			document.getElementById('sesc-share-x').addEventListener('click', function() {
				const tweet = encodeURIComponent('"' + selectedText + '" — ' + postTitle);
				const url = encodeURIComponent(postUrl);
				window.open('https://twitter.com/intent/tweet?text=' + tweet + '&url=' + url, '_blank', 'noopener');
				hidePopover();
			});

			document.getElementById('sesc-make-card').addEventListener('click', function() {
				const canvas = document.getElementById('sesc-canvas');
				const ctx = canvas.getContext('2d');

				const grad = ctx.createLinearGradient(0, 0, 1080, 620);
				grad.addColorStop(0, '#1e1b4b');
				grad.addColorStop(0.55, '#312e81');
				grad.addColorStop(1, '#0284c7');
				ctx.fillStyle = grad;
				ctx.fillRect(0, 0, 1080, 620);

				ctx.fillStyle = 'rgba(255,255,255,0.14)';
				ctx.font = 'bold 140px Georgia, serif';
				ctx.fillText('“', 65, 155);

				ctx.fillStyle = '#ffffff';
				ctx.font = '500 36px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif';
				const words = selectedText.split(/\s+/);
				let line = '';
				let y = 185;
				const maxWidth = 920;
				for (let n = 0; n < words.length; n++) {
					const testLine = line + words[n] + ' ';
					if (ctx.measureText(testLine).width > maxWidth && n > 0) {
						ctx.fillText(line, 80, y);
						line = words[n] + ' ';
						y += 52;
					} else {
						line = testLine;
					}
				}
				ctx.fillText(line, 80, y);

				ctx.strokeStyle = 'rgba(255,255,255,0.25)';
				ctx.beginPath();
				ctx.moveTo(80, 515);
				ctx.lineTo(1000, 515);
				ctx.stroke();

				ctx.fillStyle = '#bae6fd';
				ctx.font = 'bold 24px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif';
				ctx.fillText(siteName.toUpperCase(), 80, 565);

				ctx.fillStyle = '#e0e7ff';
				ctx.font = '400 22px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif';
				const shortTitle = postTitle.length > 48 ? postTitle.substring(0, 45) + '...' : postTitle;
				ctx.fillText(shortTitle, 420, 565);

				document.getElementById('sesc-canvas-preview').src = canvas.toDataURL('image/png');
				document.getElementById('sesc-modal-backdrop').style.display = 'flex';
				hidePopover();
			});

			document.getElementById('sesc-download-png').addEventListener('click', function() {
				const link = document.createElement('a');
				link.download = 'quote-card.png';
				link.href = document.getElementById('sesc-canvas').toDataURL('image/png');
				link.click();
			});

			document.getElementById('sesc-close-modal').addEventListener('click', function() {
				document.getElementById('sesc-modal-backdrop').style.display = 'none';
			});
		})();
		</script>
		<?php
	}
}

new Share_Exact_Selection_Card_Fix();

How to Install the Plugin on Your WordPress Site (3 Simple Steps)

  1. Download or Zip the File: Click the green Download Plugin (.PHP File) button above. Compress share-exact-selection-card.php into a .zip archive (e.g., share-exact-selection-card.zip).
  2. Upload in WordPress Admin: Go to your WordPress Dashboard → Plugins → Add New → Upload Plugin, choose your ZIP file, and click Install Now.
  3. Activate & Test: Click Activate Plugin. Open any published post or page, highlight a sentence, and watch the floating toolbar appear immediately—no configuration required!

Frequently Asked Questions (FAQ)

Does this plugin slow down my WordPress website?

No. Unlike heavy social suites, this plugin uses zero external libraries, zero Google Fonts requests, and injects lightweight inline scripts cleanly.

Will it work with Block Themes, Elementor, Gutenberg, or Classic Editor?

Yes! Because it hooks directly into wp_footer and listens to selection events, it works across modern block themes, Gutenberg, Classic Editor, Elementor, Divi, and Kadence themes.

Can I customize the quote card colors?

Absolutely. Inside the render_ui() method, simply edit the hex color codes in grad.addColorStop() to match your brand palette.

Found this free WordPress plugin helpful? Share it with fellow creators:

Instant Shareable Quote Card

This is what your visitors get in 1 click:

Copied to clipboard!

Built with ❤️ for the WordPress community. Free & Open Source under GPLv2.


Leave a Reply

Your email address will not be published. Required fields are marked *