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

React helmet is not showing the dynamic preview on social networks even after implementation #661

Open
rohan2734 opened this issue Dec 18, 2021 · 15 comments

Comments

@rohan2734
Copy link

to report a Bug

** current behavior?**
React helmet is not showing the dynamic preview on social networks even after implementation

What is the expected behavior?
expected behaviour is to show the dynamic preview upon different blog URLS ,but only default home page meta description is showing

https://algorithammer.herokuapp.com/

image

but the expected behaviour is to show this text
A place which fits everything with happiness are cafes. Hyderabadi now crave for the best outdoor cafe with good Caffeine for perfect socio gatherings. There are top most must visiting cafes in Hyderabad, in order with work friendly, best themed for photoshoots, with best ambience and budget friendly for every single person to chill with friends to have some alone time.

this is not working on the latest version

@mwelwankuta
Copy link

I had been experiencing the same issue. I thought maybe this was because the the Facebook and or twitter bots just scrape for the html and do not run the JavaScript, hence the social media previews come from the default meta tags in the public/index.html file. server side rendering or pre-rendering might help you with your issue.

@rohan2734
Copy link
Author

rohan2734 commented Jan 7, 2022 via email

@mwelwankuta
Copy link

@rohan2734 i understand, a simple fix is pre-rendering. if your routes are not dynamic it goes through them and creates a separate html file for each of them. but if you have meta tags with dynamic content from a database for example it could be a little tricky.

@rohan2734
Copy link
Author

rohan2734 commented Jan 7, 2022 via email

@rohan2734
Copy link
Author

rohan2734 commented Jan 7, 2022 via email

@mwelwankuta
Copy link

If the title and meta tags don't change on those routes then pre-rendering should work. As long as the meta tags are not receiving data from the database it should work.

@rohan2734
Copy link
Author

rohan2734 commented Jan 7, 2022 via email

@mwelwankuta
Copy link

That's a tough one then, you could read this article talking about SEO strategies, hope you find something that helps, would love to hear how it goes.
https://www.toptal.com/react/react-seo-best-practices

@mwelwankuta
Copy link

I was looking at the thenewboston developers' organization right here on GitHub it seems like they used a package called called react-helmet-async I haven't gone through it yet, but it seems like it would give you your desired result.

@mwelwankuta
Copy link

@rohan2734 would like to hear from you

@rohan2734
Copy link
Author

rohan2734 commented Jan 9, 2022 via email

@rmacuna
Copy link

rmacuna commented Feb 8, 2022

Having the same issue, anybody found a solution?

@Elius94
Copy link

Elius94 commented Mar 9, 2022

I think it's because this react plugin changes the index.html only if js is enabled... I suppose that the social engines that generates the preview reads only the "crude" index.js generated in the build process.

To bypass this trouble i've created this usefull npx command:

https://github.com/Elius94/js-seo-ingector

Enjoy

@premsharma1230
Copy link

i'm facing same issue for link preview , if anyone have this solution please help me

@mario8a
Copy link

mario8a commented Nov 14, 2023

I was looking at the thenewboston developers' organization right here on GitHub it seems like they used a package called called react-helmet-async I haven't gone through it yet, but it seems like it would give you your desired result.

react-helmet-async solve this problem? 😮😮

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

No branches or pull requests

6 participants