Open Graph: og:description truncation can split an HTML entity, producing "&#8217" in share previews
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Find the code that truncates Jetpack’s og:description to 197 characters and inspect how it handles entities produced by wptexturize(). Start with the Open Graph tag generation path and its tests; add a regression case where truncation lands inside an entity. Done when the generated meta description preserves the apostrophe or quote and the focused test passes.
Written by the indexing model from the issue text.
Description
Impacted plugin
Jetpack
Quick summary
When Jetpack truncates og:description to 197 characters, the cut can land in the middle of an HTML
entity created by wptexturize() (e.g. "’" for an apostrophe). esc_attr() then escapes the broken
entity, so share previews show a literal "’" in the text.
Steps to reproduce
- On a site with Jetpack's Open Graph tags enabled, create a post with no manual excerpt.
- Write the opening paragraph so an apostrophe (or a curly quote or dash) falls right around the 197th
character, e.g. "...Most recently I've had all my domains through Namecheap. I've never used any of
Namecheap's other services, though..." - Publish the post and view the page source.
- Look at the og:description meta tag. It ends with "Namecheap’…" instead of "Namecheap’s…".
- Optionally, share the post URL on Mastodon, iMessage or Slack: the preview shows a literal "’"
in the text.
Mine is a live example: https://initialcharge.net/2026/11/namecheap-to-porkbun/
Site owner impact
Fewer than 20% of the total website/platform users
Severity
Minor
What other impact(s) does this issue have?
No revenue impact
If a workaround is available, please outline it here.
Two options:
-
Write a manual excerpt for the affected post. Make it short enough not to be truncated (under 197
characters), or check that no apostrophe, curly quote or dash sits at the cut point. -
Remove the partial entity with the jetpack_open_graph_tags filter, which runs after the truncation:
add_filter( 'jetpack_open_graph_tags', function ( $tags ) {
if ( ! empty( $tags['og:description'] ) ) {
// Drop a half-cut entity (e.g. "’") left right before the trailing ellipsis.
$tags['og:description'] = preg_replace( '/&#?[a-z0-9]*…$/i', '…',
$tags['og:description'] );
}
return $tags;
} );
Platform (Simple and/or Atomic)
Self-hosted
- Dominant language
- PHP
- Stars
- 1.9k
- Forks
- 913
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 809
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/jetpack
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/jetpack#55385 · 1 comment ·
Maintainers usually reply within 1 day
-
WAF: jetpack_waf_blocklog is created without the site's charset and collationPossibly taken @jwebbdev claimed this 3 days ago. Open[Plugin] Protect Bug Customer Report
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Automattic/jetpack#55365 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Package] Stats Admin [Type] Bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Automattic/jetpack#54188 ·
Maintainers usually reply within 1 day
-
Bug Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/jetpack#53467 ·
Maintainers usually reply within 1 day
-
Brute_Force_Protection: two deprecated static wrappers throw Error on PHP 8 (self:: to non-static methods)Possibly taken @Valley-15 claimed this 85 days ago. OpenBug Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Automattic/jetpack#51728 ·
Maintainers usually reply within 1 day
All issues in Automattic/jetpack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/blocks-engine#7881 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
iruzen-dono/workless#117 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
magicsunday/webtrees-docker#285 ·
Maintainers usually reply within 1 day
-
area/tests type/bug when/soon
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbookPossibly taken @mayankmajeji claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
WordPress/hosting-handbook#521 ·