Make WordPress Core

Opened 2 years ago

Last modified 8 months ago

#61249 new enhancement

The character count in the post_excerpt is fine instead of counting words.

Reported by: sarkarripon Owned by:
Priority: normal Milestone: Awaiting Review
Component: Posts, Post Types Version: 6.5.3
Severity: normal Keywords: dev-feedback
Cc: Focuses: administration

Description

It is known that multiple words written without spaces are counted as a single word. This could lead to situations where an excerpt includes a string of characters (which should be separate words) that significantly exceeds the intended limit but is still accepted because it is counted as only one word due to the lack of spaces.

The ultimate goal of imposing a limit on the excerpt is to ensure that it remains concise and to the point. By not accurately counting characters, and thus potentially allowing excerpts to be longer than intended, the system fails to achieve its true purpose. This could affect how excerpts are displayed or how much space they take up on a website or in an admin interface.

Including a character count would provide a more precise and predictable way to limit the length of excerpts. It would ensure consistency regardless of how words are spaced and would give administrators a clear indication of how much text they can include.

Change History (2)

#1 @dmsnell
2 years ago

@sarkarripon you may be interested in the ​wp_trim_excerpt filter which provides you the ability to further limit the generated excerpt, such as if it's longer than you want.

#2 @sajib1223
8 months ago

  • Keywords needs-testing removed
  • Type defect (bug) → enhancement

This is an enhancement or feature request, nothing to test here.

Note: See TracTickets for help on using tickets.