Skip to Content
Housr WebappSEO Optimisations

SEO Optimisations

Documentation of all SEO optimisations implemented across the Housr webapp.


1. Metadata & Meta Tags

Global Metadata (src/app/[locale]/layout.tsx)

Every page inherits a comprehensive metadata baseline from the locale layout:

  • Title template: "%s | Housr" with a default title for untitled pages
  • Description: Platform-wide description targeting student accommodation keywords
  • Keywords: 10 core keywords (student accommodation, student housing, student houses for rent, student flats, student rooms, university accommodation, student lettings, student property, student living, student apartments)
  • Authors / Creator / Publisher: Set to “Housr”
  • Format detection: Disabled auto-linking for email, address, and telephone
  • Metadata base: https://housr.com (ensures all relative URLs resolve correctly)

Page-Level Metadata

Every user-facing page exports a generateMetadata function with page-specific:

  • Title and description tailored to the page content
  • Keywords (city pages include 12 location-specific keyword variations)
  • Canonical URL via alternates.canonical
  • OpenGraph and Twitter Card tags (see sections below)
  • Robots directives (see section below)

Pages with dynamic metadata: home, blog index, blog posts, city pages, city sub-pages, property detail pages, student accommodation hub, UK rental pages.


2. OpenGraph

Configured globally in the locale layout and overridden per-page where needed:

  • Type: website (pages) / article (blog posts with publishedTime)
  • Locale: en_GB or en_US based on current locale
  • Site name: “Housr”
  • Images: /images/og-thumbnail.webp at 1200x630 with descriptive alt text
  • Property pages: Up to 4 property images pulled dynamically from listing data
  • Blog posts: Feature image from Sanity CMS at 1200x630

3. Twitter Cards

Configured globally and per-page:

  • Card type: summary_large_image
  • Site / Creator: @housrapp
  • Title, description, image: Mirrors OpenGraph values

4. Structured Data (JSON-LD)

Reusable structured data components in src/components/structured-data.tsx, all output as <script type="application/ld+json">:

Schema TypeComponentUsed On
WebSiteWebsiteStructuredDataHome page. Includes SearchAction targeting /en-gb/student-accommodation/\{search_term\}
OrganizationOrganizationStructuredDataHome page. Logo, social profiles (Twitter, LinkedIn), customer service contact point
LocalBusinessLocalBusinessStructuredDataCity pages, UK rental pages. City-specific name, address, service type, area served
FAQPageFAQStructuredDataCity pages (when FAQ content exists in CMS)
BreadcrumbListBreadcrumbStructuredDataCity pages, sub-pages, property detail pages. Full URL breadcrumb trail
  • City page: Home > Student Accommodation > {City}
  • Sub-page: Home > Student Accommodation > {City} > {Location}
  • Property page: Home > Student Accommodation > {City} > {Bedroom count} Bedroom

5. Canonical URLs & Hreflang

Canonical URLs

Every page sets alternates.canonical pointing to its authoritative URL on https://housr.com.

Hreflang (src/lib/utils/hreflang.ts)

  • Dynamic generation: generateHreflangTags() produces en-GB, en-US, and x-default tags based on the current page and locale
  • x-default: Points to the UK (en-GB) version when a UK equivalent exists, otherwise US
  • Page mapping: Shared pages (home, about, brand-ambassadors, privacy, terms, parents, blog) have cross-locale equivalents
  • Client component (src/components/hreflang-tags-client.tsx): Renders hreflang <link> tags in the <head> on every page
  • Metadata helper (hreflangTagsToMetadata()): Converts hreflang tags into Next.js metadata format for use in generateMetadata

Language Attribute (src/components/lang-attribute-setter.tsx)

Sets document.documentElement.lang to en-GB or en-US based on the active locale.


6. Sitemap (src/app/sitemap.xml/route.ts)

Dynamic XML sitemap generated at /sitemap.xml:

  • Revalidation: Every 24 hours (revalidate = 86400)
  • Cache headers: public, max-age=3600, s-maxage=86400

Included Pages

SectionPagesPriorityChange Frequency
Roothousr.com1.0daily
UK static/en-gb, /en-gb/student-accommodation, /en-gb/about, /en-gb/brand-ambassadors, /en-gb/partners/lettings, /en-gb/student-bills-packages, /en-gb/student-bills-packages/quote, /en-gb/terms, /en-gb/privacy0.3 - 1.0daily - yearly
US static/en-us, /en-us/about, /en-us/brand-ambassadors, /en-us/colleges, /en-us/properties, /en-us/perks, /en-us/perks/subscribe, /en-us/perks/payment, /en-us/rideshare, /en-us/privacy, /en-us/parents0.3 - 1.0monthly - daily
UK city pages/en-gb/student-accommodation/\{city\} (dynamic from DB)0.9daily
UK sub-pages/en-gb/student-accommodation/\{city\}/\{slug\} (dynamic from CMS)0.8weekly

7. Robots (src/app/robots.txt/route.ts)

Dynamic robots.txt at /robots.txt:

User-agent: * Allow: / Disallow: /api/ Disallow: /actions/ Disallow: /admin/ Disallow: /private/ Disallow: *.json Sitemap: https://www.housr.com/sitemap.xml

Cache headers: public, max-age=3600, s-maxage=86400

Page-Level Robots Metadata

Pages include explicit robots directives via Next.js metadata:

robots: { index: true, follow: true, googleBot: { index: true, follow: true, "max-video-preview": -1, "max-image-preview": "large", "max-snippet": -1, }, }

This ensures Google displays large image previews and full snippets in search results.


8. Redirects (next.config.ts)

All redirects use permanent: true (HTTP 301) to preserve link equity:

US Bare Path Redirects

Old bare paths redirect to their /en-us/ equivalents: /colleges, /partners, /students, /parents, /about, /blog, /perkterms, /privacy, /brand-ambassadors, /terms

UK Path Migrations

Old /uk/ paths redirect to new /en-gb/ URLs:

  • /uk > /en-gb
  • /uk/about > /en-gb/about
  • /uk/blog > /en-gb/blog
  • /uk/terms > /en-gb/terms
  • /uk/privacy > /en-gb/privacy
  • /uk/brand-ambassadors > /en-gb/brand-ambassadors
  • /uk/parents > /en-gb/parents

UK Feature Path Renames

Old feature paths redirect to new SEO-friendly URLs:

  • /uk/roomie > /en-gb/features/roomie
  • /uk/bills > /en-gb/student-bills-packages
  • /uk/bills/quote > /en-gb/student-bills-packages/quote
  • /uk/lettings > /en-gb/partners/lettings
  • /uk/universities > /en-gb/partners/universities

UK Rental > Student Accommodation

  • /uk/rental > /en-gb/student-accommodation
  • /uk/rental/:city > /en-gb/student-accommodation/:city
  • /uk/rental/:city/property/:id > /en-gb/student-accommodation/:city/property/:id

9. Static Generation & Caching

Static Params (generateStaticParams)

Pages pre-rendered at build time:

  • Locale layout: Both us and uk locales
  • Blog posts: All posts from Sanity CMS
  • City pages: All cities from the database
  • City sub-pages: All sub-page slugs from CMS
  • UK rental pages: All cities from the API

Incremental Static Regeneration (ISR)

Page TypeRevalidation Period
Sitemap86,400s (24 hours)
City pages, sub-pages, property pages3,600s (1 hour)
UK rental pages10,800s (3 hours)
API GET requests (default)3,600s (1 hour)
Blog posts60s (1 minute)

Server-Side Caching (unstable_cache)

  • Cities list: 86,400s, tag "cities"
  • City property counts: 86,400s, tag "properties"
  • Search results: 10,800s
  • Area property counts: 10,800s, tag "properties"

10. Performance & Crawlability

Next.js Config (next.config.ts)

  • Compression: Enabled (compress: true)
  • Powered-by header: Disabled (poweredByHeader: false)
  • ETags: Disabled (generateEtags: false) in favour of CDN-level caching
  • Image optimisation: Next.js <Image> with configured remote patterns for all property image sources

Security Headers (applied to all routes)

  • X-Content-Type-Options: nosniff
  • X-Frame-Options: DENY
  • X-XSS-Protection: 1; mode=block
  • Referrer-Policy: strict-origin-when-cross-origin

11. URL Structure

SEO-friendly URL patterns using descriptive, keyword-rich paths:

PatternExample
/en-gb/student-accommodation/\{city\}/en-gb/student-accommodation/manchester
/en-gb/student-accommodation/\{city\}/\{slug\}/en-gb/student-accommodation/manchester/fallowfield
/en-gb/student-accommodation/\{city\}/property/\{id\}/en-gb/student-accommodation/manchester/property/123
/en-gb/student-bills-packagesKeyword-rich path (was /uk/bills)
/en-gb/partners/lettingsKeyword-rich path (was /uk/lettings)

Internal rewrites map these public-facing paths to internal route handlers transparently.


12. PWA Manifest (public/manifest.json)

  • Name: “Housr - The Home of Student Living”
  • Categories: lifestyle, education, housing
  • Icons: 16x32, 180x180, 192x192, 512x512
  • Display: standalone
  • Language: en-GB
Last updated on