10up / headstartwp

Build a headless website fast with WordPress, the world’s most popular CMS, and Next.js, the most popular React framework. A free and open source solution by the experts at 10up.
https://headstartwp.10up.com
166 stars 17 forks source link

useYoastHTML - some fields don't update when navigating between pages #699

Open johnwatkins0 opened 9 months ago

johnwatkins0 commented 9 months ago

Describe the bug

While this is an issue on my project, I have also verified that it is occurring on another project using this framework.

When passing useYoastHtml into the Headless app component, the page metadata within the document head seems to be correct, but when navigating around the site via internal links, many of the fields don't update. The title component updates, but from what I can see, other fields don't.

Steps to Reproduce

  1. Navigate to a page on a site using the useYoastHTML option and open the document head in the Elements tab of your browser dev tools.
  2. Click an internal link on the page.
  3. Notice that the title updates but nothing else in the head.
  4. Completely refresh the page and see that the head does have the expected content.

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

nicholasio commented 8 months ago

I can replicate on your project but on the default project 🤔 .

This issue has been haunting us for a while.... In the past I was able to replicate this issue only when GTM was being added to the page but it doesn't seem to be the case now.

What I think it's happening though is that the page ends up with both the previous values and the new ones, so we need to find a way to clear up the old meta tags.