DEV Community

Cover image for How I Used Claude CLI to Fix My Laravel SaaS Site’s SEO (Zero Traffic Fully Optimized)
Rustamjon Akhmedov
Rustamjon Akhmedov

Posted on

How I Used Claude CLI to Fix My Laravel SaaS Site’s SEO (Zero Traffic Fully Optimized)

How I Used Claude CLI to Fix My Laravel SaaS Site’s SEO (Zero Traffic → Fully Optimized)

After spending months building my Laravel SaaS, I expected slow growth — but not zero organic traffic.

The product worked. The UI was clean. Everything deployed smoothly.

Google? Completely unimpressed.

So I did what any developer would do:

I asked an AI to debug my SEO.


The Stack

My project:

  • Laravel 12
  • Livewire 3
  • mcamara/laravel-localization
  • AI-powered accessibility tool (altaudit.com)

Five languages. Marketing pages. Blog. Clean architecture.

Traffic: basically none.


The SEO Audit

Using Claude CLI, I ran a structured audit of the live site.

The result was brutal — and incredibly useful.

Critical Issues Found

Problem Why It Matters
No Sitemap: in robots.txt Google may not auto-discover pages
Zero canonical tags Duplicate content risk (especially multilingual sites)
No Open Graph tags Broken social previews
No structured data (JSON-LD) No eligibility for rich results
hreflang only on homepage Localized pages invisible to search engines
No noindex on auth pages Crawl budget wasted on /login, /dashboard

Nothing catastrophic individually.

Together? SEO invisibility cloak.


Phase 1 — Crawl & Indexing Fixes

robots.txt

User-agent: *
Disallow: /dashboard
Disallow: /login
Disallow: /register
Disallow: /livewire/
Sitemap: https://altaudit.com/sitemap.xml
Enter fullscreen mode Exit fullscreen mode

Canonical Tags

Added to layouts:

<link rel="canonical" href="{{ url()->current() }}">
Enter fullscreen mode Exit fullscreen mode

noindex for Private Pages

<meta name="robots" content="noindex, nofollow">
Enter fullscreen mode Exit fullscreen mode

Phase 2 — Open Graph & hreflang

Open Graph

<meta property="og:title" content="{{ __('meta.title') }}">
<meta property="og:description" content="{{ __('meta.description') }}">
<meta property="og:url" content="{{ url()->current() }}">
<meta property="og:image" content="{{ asset('images/preview.png') }}">
Enter fullscreen mode Exit fullscreen mode

hreflang (Multilingual SEO Essential)

@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)
<link rel="alternate" hreflang="{{ $localeCode }}"
      href="{{ LaravelLocalization::getLocalizedURL($localeCode) }}">
@endforeach

<link rel="alternate" hreflang="x-default"
      href="{{ LaravelLocalization::getLocalizedURL('en') }}">
Enter fullscreen mode Exit fullscreen mode

Without this, Google treats translations like unrelated pages.


Phase 3 — Structured Data (JSON-LD)

This is where Laravel developers hit a classic trap.

The Blade @context Bug

Blade interprets @context, @type, etc. as directives.

Result: ParseError.

Correct Fix

<script type="application/ld+json">
@verbatim
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Alt Audit"
}
@endverbatim
</script>
Enter fullscreen mode Exit fullscreen mode

Alternative for dynamic JSON:

"@@context": "https://schema.org"
Enter fullscreen mode Exit fullscreen mode

Yes, this feels weird. Yes, it works.


Unexpected Laravel Gotchas

1️⃣ route:cache + Localization = Disaster

If you're using mcamara/laravel-localization:

php artisan route:cache  # ❌ DON'T
Enter fullscreen mode Exit fullscreen mode

Localized routes are dynamic.

Use:

php artisan route:clear
Enter fullscreen mode Exit fullscreen mode

2️⃣ view:clear Isn’t Always Enough

Sometimes compiled Blade views linger:

rm -f storage/framework/views/*.php
php artisan view:cache
Enter fullscreen mode Exit fullscreen mode

Instant mystery bug resolution.


3️⃣ Quotes Inside {{ }}

{{-- WRONG --}}
gtag('config', '{{ config('services.ga.id') }}')

{{-- CORRECT --}}
gtag('config', '{{ config("services.ga.id") }}')
Enter fullscreen mode Exit fullscreen mode

Tiny detail → fatal error.


New Pages That Actually Matter

SEO isn’t just tags.

It’s intent targeting.

I added:

  • /about → E-E-A-T signals
  • /wcag-compliance
  • /alt-text-seo

Each translated into 5 languages.


What Claude CLI Was Actually Good At

Not magic.

Not "AI hype."

Just extremely efficient at:

✔ Reading real Blade files

✔ Finding real structural problems

✔ Applying consistent fixes

✔ Avoiding generic SEO advice

Most value came from systematic analysis, not individual snippets.


Final State

Every public page now has:

✅ Canonical

✅ Open Graph

✅ hreflang

✅ JSON-LD

✅ Proper robots directives

From invisible → properly indexed candidate.


Key Takeaway

Most Laravel SaaS SEO problems are not complex.

They are death by small omissions.

Canonical missing. hreflang incomplete. robots.txt half-configured.

Individually harmless.

Collectively fatal.


If you’re building a Laravel product and planning to “fix SEO later”…

Later is why Google ignores you.


Curious what your site is silently missing? Run an audit. You might be surprised.

Top comments (0)