Nicom's avatar
Level 2

SEO results with Inertia SSR are low

Hi guys!

I recently made a small app with Laravel and vanilla js. The point is that approximately 2 months ago I rebuilt my app with inertia ssr and the SEO has not stopped going down since that moment.

I am a beginner, but I think I configured everything correctly, in fact if I enter the browser and deactivate javascript my webapp can be seen, so I understand that Google is able to read it.

I also made another 2nd app from scratch with ssr inertia and the SEO results are also very poor.

2 weeks ago I made my last webapp with Livewire and alpine and it has better results than my two apps created with inertia ssr.

Has this happened to anyone else? Could it be that Inertia SSR is not so good for SEO?

1 like
6 replies
LaryAI's avatar
Level 58

It sounds like you're experiencing issues with SEO performance after switching to Inertia.js with Server-Side Rendering (SSR). While Inertia.js with SSR should theoretically improve SEO by rendering pages on the server, there are several factors that could be affecting your SEO results. Here are some steps and considerations to help you troubleshoot and potentially improve your SEO:

1. Ensure Proper Meta Tags and Content

Make sure that your pages have the correct meta tags, titles, and descriptions. These are crucial for SEO.

<head>
    <title>Your Page Title</title>
    <meta name="description" content="Your page description">
    <meta name="keywords" content="your, keywords, here">
    <!-- Other meta tags -->
</head>

2. Check for Proper SSR Configuration

Ensure that your Inertia.js SSR setup is correctly configured. Here is a basic example of how you might set up SSR with Inertia.js in a Laravel application:

// In your routes/web.php
use Inertia\Inertia;

Route::get('/', function () {
    return Inertia::render('Home', [
        'title' => 'Home Page',
        'description' => 'This is the home page description',
    ]);
});

3. Verify Server-Side Rendering

Make sure that the content is actually being rendered on the server. You can check this by viewing the page source in your browser (right-click -> View Page Source). You should see the HTML content directly in the source, not just a JavaScript bundle.

4. Use SEO Tools

Use tools like Google Search Console, Lighthouse, or other SEO auditing tools to identify specific issues. These tools can provide insights into what might be going wrong.

5. Sitemap and Robots.txt

Ensure you have a proper sitemap and robots.txt file. These help search engines crawl and index your site more effectively.

# robots.txt
User-agent: *
Disallow: /admin/
Allow: /

Sitemap: https://yourdomain.com/sitemap.xml

6. Monitor and Compare

Since you mentioned that your Livewire and Alpine.js app has better SEO results, compare the differences in how content is rendered and served between the two setups. Look for differences in meta tags, content structure, and loading times.

7. Performance Optimization

Ensure that your pages load quickly. Page speed is a significant factor in SEO rankings. Use tools like Google PageSpeed Insights to identify and fix performance issues.

8. Regular Content Updates

Regularly update your content and ensure it is relevant and valuable to your audience. Fresh content can help improve SEO rankings.

Example of a Basic Inertia.js SSR Setup in Laravel

Here is a basic example of setting up Inertia.js with SSR in a Laravel application:

// In your routes/web.php
use Inertia\Inertia;

Route::get('/', function () {
    return Inertia::render('Home', [
        'title' => 'Home Page',
        'description' => 'This is the home page description',
    ]);
});
// In your resources/js/Pages/Home.vue
<template>
  <div>
    <h1>{{ title }}</h1>
    <p>{{ description }}</p>
  </div>
</template>

<script>
export default {
  props: {
    title: String,
    description: String,
  },
}
</script>

Conclusion

SEO is a complex field with many factors at play. By ensuring that your Inertia.js SSR setup is correctly configured, monitoring your site with SEO tools, and comparing with your other projects, you should be able to identify and address the issues affecting your SEO performance. If the problem persists, consider consulting with an SEO expert who can provide more tailored advice based on a detailed analysis of your site.

gych's avatar

First test your website via Lighthouse and see which results you get from that. I have no issues with SEO and Inertia SSR.

1 like
JussiMannisto's avatar

What are the SEO results that you're referring to? Traffic to the website?

Two months is a very short time. If it's a brand new site, Google may offer it as a search result to its users. If the results are not relevant to users, your ranking will start to drop.

The technology of the site shouldn't matter as long as:

  1. The content on your site is relevant to users.
  2. The content is well structured and semantically correct.
  3. The site is crawlable: every page has an address, you don't use path hacks (like #/my-route), and you use proper links with hrefs instead of JS navigation.
  4. The site isn't super slow.

Note that speed isn't the most important factor from a SEO standpoint, nor is it a sliding scale where a 10% faster page is ranked higher than others. Google just uses speed to classify sites, like fast/medium/slow.

SSR or MPA sites are not inherently better than SPAs. Google is aware of how SPAs work and they take that into account. They cache assets and crawl pages in two steps: before and after JS has done loading.

There's a lot of old SEO misinformation floating about. If you want real information, check what Google has to say. I suggest the YouTube channel Google Search Central as a starting point.

SEO consultants I would avoid.

2 likes
Estinvosh's avatar

I’d check if your SSR actually returns full HTML in the page source, not just what shows with JS off. Also make sure each route sets proper meta tags and unique titles.

1 like
vincent15000's avatar

Inertia SSR cannot be good or bad with SEO.

I just finished an application with its first functionalities with Laravel / InertiaJS / VueJS and SEO is very good.

SEO depends on several factors. You should check which one is responsible for a bad SEO.

imranbru's avatar

check your page source which data google can get check and develop it. Google never get frontend data. somedays ago i developed a next js application which page data showing fine in frontend and pagesource failed to show these data. finally i solve it,,page source and understand the technical seo issue from: Screaming Frog SEO Spider: https://prnt.sc/qQFnPfXgOYRp

1 like

Please or to participate in this conversation.