Skip to content

OpenGraph: Improve default og:title for search results page #14677

@GaryJones

Description

@GaryJones

Steps to reproduce the issue

  1. Do a front-end search on a site with Jetpack enabled.
  2. View the source and look for og:title
  3. Value is "(no title)"

What I expected

It would be good to have a default value of "Search results: {search term}" or something similar, for the og:title. Other OG tags may also benefit from being tweaked for the search results page.

What happened instead

<meta property="og:site_name" content="{redacted}" />
<meta property="og:image" content="https://{redacted}" />
<meta property="og:image:width" content="449" />
<meta property="og:image:height" content="449" />
<meta property="og:title" content="(no title)" />
<meta property="fb:app_id" content="{redacted}" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="{redacted}" />
<meta property="og:locale" content="en_GB" />
<meta property="fb:pages" content="{redacted}" />

Seems like this code is missing is_search() condition and logic.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions