We recently went through a full technical SEO cleanup on our own agency site (Next.js, static export). A few of the issues we found were sneaky — they don't break the site visually, but they quietly hurt indexing and rankings. Here's what we fixed.
1. Sitemap trailing slash mismatch
Our sitemap listed URLs like /services/ (with trailing slash) but the actual pages resolved at /services (no slash). Google Search Console flagged some of these as "Page with redirect" or simply didn't index them properly.
Simplified fix in sitemap.js:
export default function sitemap() {
return [
{
url: 'https://example.com/services', // no trailing slash — match your actual routes
lastModified: new Date(),
},
]
}
Lesson: your sitemap URLs must exactly match how your routes actually resolve — trailingSlash config in next.config.js needs to agree with what's in the sitemap.
2. Keyword stuffing cleanup
Some of our early pages had meta titles and descriptions that were overstuffed with keywords, trying to rank for too much at once. We rewrote them to be natural, specific, and under the recommended length (~60 chars for titles, ~155 for descriptions).
3. Canonical tags
We added canonical tags across all pages to avoid duplicate content issues, especially important on a static export where trailing slashes or query params can create near-duplicate URLs.
export const metadata = {
alternates: {
canonical: 'https://example.com/services',
},
}
4. JSON-LD structured data
Added JSON-LD schema (Organization, LocalBusiness where relevant) to help Google understand what the business actually is — useful for rich snippets and local search relevance.
5. robots.js + sitemap.js setup
Instead of static robots.txt/sitemap.xml files, we used Next.js's built-in robots.js and sitemap.js route handlers — cleaner to maintain and less error-prone than hand-written XML.
Result
After these fixes, our previously stuck /services page got properly indexed in Google Search Console, and overall crawl errors dropped.
Takeaway
If pages aren't indexing the way you expect, check in this order:
- Sitemap URLs vs actual route URLs (trailing slash mismatches are common)
- Canonical tags pointing to the right version
- Meta tags — over-optimization can hurt as much as under-optimization
We're BrandLumeo, a digital marketing agency working across Kerala and Dubai — handling everything from Meta Ads to web development and SEO. Happy to hear how others have handled similar indexing quirks!
Top comments (0)