Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

miro4994's avatar

Laravel & React/Vue handling SEO "different way" in SPA

Hey guys! I´ve been looking for a way how to solve a problem of handling server-side rendering with react because of the SEO. And I have to say that it was quite complicated and overheliming for me using all the stuff like node/express/v8js. So I have an idea how to solve it different way and i would like to know your opinion on it.

All the tutorials around the google will tell you to render index.php with the empty app div + loader and then load all the content through AJAX into it. However there is a problem with a SEO.

So i was thinking about why don´t render the index.php with all the necessary content for SEO like title, meta tags (schema), facebook/twitter cards etc. and also important stuff like shop item description etc. into a hidden element with the only one visible element = loader and then just continue as a SPA? The user would basicly see the loader only once and than continue in SPA however the SEO should be good now for crawling all the necessary pages.

I know that I would need to build an API for clientside and also additional views/controllers for serverside but i think it could be easier than using all the stuff like node/express/v8js. The only downside for the user should be only loading the content twice (serverside rendering then cilentside AJAX ) when entering the page.

What do you think about this way of handling SEO within SPA? Also sorry for my bad english. Hope someone will answer me! :)

0 likes
3 replies
miro4994's avatar

Thanks i wasnt really sure if Google executes the javascript now i´m so SEO should be good with client side rendering only. However there will be still a problem with sharing social links. I´mean, Google executes javascript and know how the content looks like but what about the facebook/twitter and their cards ( og/ twitter:card meta tags )? I would like to share shop items around the social sites and i think it would not be possible without my "different way" of handling SEO => hidden server-side rendered content with meta tags + loader and then continue as SPA.

Any answers? :)

Please or to participate in this conversation.