George Bleasdale
George Bleasdale

Reputation: 351

How does google index automatically generated pages like user profiles?

I'm fairly new to web app development, I've been working with React. I'd like to build a social media website with publicly viewable user profiles. When a user clicks to view a profile the UserProfile component would populate with data from the database. My question is, would these user profiles be indexed by google even though they are being dynamically generated and therefore aren't static pages? Does the fact that each profile has its own url mean that it will be indexed as a unique page?

Upvotes: 0

Views: 143

Answers (3)

Osman Safak
Osman Safak

Reputation: 255

You can use SSR to do this.

I'm using Next.js.

Because the render process is server-side, you cannot retrieve the data you hold in localstorage during the rendering process. To do this, you need to store the user information using the cookie.

These processes are a little more advanced.

Upvotes: 0

Abhi
Abhi

Reputation: 398

The googlebot, waits for your Website to render content for a short amount of time(40 seconds, not sure), then it indexes the webpage. The googlebot runs the same Chrome engine, but a older version of it(Chrome 41(M41)), so it may not support all the modern javascript features.

So you have to make sure, that your SPA renders its content in short time and can run on googlebot's javascript engine.

You can find more about it here

Upvotes: 0

Zoltán Szepesi
Zoltán Szepesi

Reputation: 591

To my knowledge google can run javascript while crawling webpages. If you want your site to render correctly in twitter cards or facebook shares you can use prerendering or make your app an universal app.

Prerendering is when you check for crawlers' user agent and redirect them to a static page which you render using some browser.

In universal apps you render the basic information and meta tags on the server so when crawlers access your site they can get the important information. And you load your react app on top of that for the UX

Upvotes: 0

Related Questions