Skip to content

Fix SEO description validation threshold to match error message#3689

Open
J8118 wants to merge 1 commit intoShopify:mainfrom
J8118:fix/seo-description-threshold-mismatch
Open

Fix SEO description validation threshold to match error message#3689
J8118 wants to merge 1 commit intoShopify:mainfrom
J8118:fix/seo-description-threshold-mismatch

Conversation

@J8118
Copy link
Copy Markdown

@J8118 J8118 commented Apr 10, 2026

Summary

In generate-seo-tags.ts, the description validation rejects values longer than 155 characters (value.length > 155), but the error message tells the user the limit is 160 characters. A 156-character description would be rejected with the message "should not be longer than 160 characters" — which is contradictory.

Standard SEO guidance typically recommends ~155-160 characters. The fix should align the threshold with the message.

File changed:

  • packages/hydrogen/src/seo/generate-seo-tags.ts (lines 36-41)

Change threshold to match message:

if (typeof value === 'string' && value.length > 160) {

The validation rejected descriptions longer than 155 characters but
the error message said the limit was 160. Aligned the threshold to
160 to match the message and standard SEO guidance.
@J8118 J8118 requested a review from a team as a code owner April 10, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant