Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: override get_head search request metadata #663

Merged
merged 9 commits into from
Jan 26, 2024

Conversation

lucymtc
Copy link
Contributor

@lucymtc lucymtc commented Jan 12, 2024

Description of the Change

Yoast does not yoast_head to the WordPress search endpoint.
Yoast is not properly detecting a search page via the get_head function.

These changes fix the SEO title and canonical URL for the search results when requesting to yoast get_head endpoint.
Note: I have installed a fresh instance of WP to test the get_head endpoint for search results and the response matches the home yoast_head. However running WP in wp-env inside of headstartwp the response is 404 for unknown reason.

Closes #537

How to test the Change

Changelog Entry

Added - New feature
Changed - Existing functionality
Deprecated - Soon-to-be removed feature
Removed - Feature
Fixed - Bug fix
Security - Vulnerability

Credits

Props @username, @username2, ...

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link

changeset-bot bot commented Jan 12, 2024

🦋 Changeset detected

Latest commit: 366ffab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@headstartwp/headstartwp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headstarwp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2024 9:16am

Copy link
Contributor

📦 Next.js Bundle Analysis for @10up/headless_framework

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

📦 Next.js Bundle Analysis for @10up/headless_framework

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

📦 Next.js Bundle Analysis for @10up/headless_framework

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

📦 Next.js Bundle Analysis for @10up/headless_framework

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Member

@nicholasio nicholasio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works fine for single words searches.

It would be great to support pagination.

wp/headless-wp/includes/classes/Integrations/YoastSEO.php Outdated Show resolved Hide resolved
wp/headless-wp/includes/classes/Integrations/YoastSEO.php Outdated Show resolved Hide resolved
Copy link
Contributor

📦 Next.js Bundle Analysis for @10up/headless_framework

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

📦 Next.js Bundle Analysis for @10up/headless_framework

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@nicholasio
Copy link
Member

@lucymtc Can you add a changeset?

Copy link
Contributor

📦 Next.js Bundle Analysis for @10up/headless_framework

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

📦 Next.js Bundle Analysis for @10up/headless_framework

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@nicholasio nicholasio merged commit d33ffc4 into develop Jan 26, 2024
11 checks passed
@nicholasio nicholasio deleted the fix/search-metadata branch January 26, 2024 14:00
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.

Unable to fetch head metadata on search strategy when search keys has more than one word
2 participants