question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DefaultSeo og:title and og:description only overridden by NextSeo when openGraph config provided

See original GitHub issue

Hi! First off, thank you so much for this library!

I noticed some unexpected behavior (not sure if it’s a bug or intended) when using DefaultSeo and NextSeo. The DefaultSeo og:title and og:description meta tags are not overridden by NextSeo’s title and description configurations unless an openGraph configuration object is provided to NextSeo. I believe this is due to https://github.com/garmeeh/next-seo/blob/master/src/meta/buildTags.tsx#L152 evaluating as falsy in NextSeo so the og:* meta tags are never updated.

I’ve reproduced this behavior in the sandbox below where the / page does not successfully overwrite the meta tags while the /about page does.

https://codesandbox.io/s/serene-mcnulty-ofcu3

Let me know if anything else would be useful to debug!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Aug 19, 2021

It’s not yet fixed. Temporary workaround is to just provide an empty object to the openGraph property:

<NextSeo title="My custom title" description="My custom description" openGraph={{}} />

This will overwrite/update the og:title and og:description, because openGraph will evaluate to truthy in buildTags.tsx: https://github.com/garmeeh/next-seo/blob/420eb12ff7c6d2e15412d3bd09a0dca27863084f/src/meta/buildTags.tsx#L188

1reaction
jordanlambrechtcommented, Jun 21, 2022

I’m still experiencing this. If an OpenGraph image array is defined in DefaultSEO, it overrides individual pages’ default images. Any updates?

Read more comments on GitHub >

github_iconTop Results From Across the Web

DefaultSeo og:title and og:description only overridden by NextSeo ...
I noticed some unexpected behavior (not sure if it's a bug or intended) when using DefaultSeo and NextSeo . The DefaultSeo og:title and...
Read more >
NextSeo is not overriden in each component when I use ...
I want to change the Head tag dynamically using next-seo. Browser validation will reflect NEXTSeo for individual pages, but Twitter, Firebase's ...
Read more >
next-seo - npm
This plugin is compatible with version 6.0.0 + of next. NOTE: The feature of having multiple Open Graph images is only available in...
Read more >
SEO in Next.js and Prismic - Gary Meehan
We look at default SEO, page specific SEO, Open Graph tags and JSON-LD. ... config.js export const DEFAULT_SEO = { title: 'Next.js &...
Read more >
Open Graph Meta Tags: Everything You Need to Know - Ahrefs
Setting Open Graph tags in Squarespace ... Squarespace uses the page title and meta description for og:title and og:description . You can set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found