Title Tags

5-10 minBeginner

Craft CMS provides flexible title tag control through Twig templates, SEO plugins like SEOmatic, or custom field configurations. This guide covers all approaches from simple to advanced, helping you implement the right solution for your project.

Prerequisites

  • Craft CMS installation (v3 or v4)
  • Admin access
  • Basic Twig template knowledge (for template method)
  • Access to templates folder
Easy Recommended

SEOmatic Plugin (Recommended)

The most comprehensive SEO solution for Craft CMS. Handles title tags, meta descriptions, JSON-LD, and more.

1

Install SEOmatic

1

Go to Plugin Store in Craft admin

2

Search for 'SEOmatic'

3

Click Install

4

Or via CLI: composer require nystudio107/craft-seomatic

2

Configure Global Settings

1

Navigate to SEOmatic > Global SEO

2

Set your Site Name

3

Choose Title Position: Before or After site name

4

Set Title Separator: | - — or custom

5

Configure default title template

Example
Template format: {entry.title} {separator} {siteName}
3

Configure Content SEO

1

Go to SEOmatic > Content SEO

2

Select each Section (Blog, Pages, etc.)

3

Set title template for that section type

4

Use Twig variables: {entry.title}, {category.title}

4

Override per Entry

1

Edit any entry in the admin

2

Click 'SEO' tab (or SEOmatic panel)

3

Enter custom 'SEO Title' to override template

4

Real-time preview shows SERP snippet

5

Character counter helps stay under 60

Best Practices

Do

  • Use SEOmatic for comprehensive SEO management
  • Keep titles under 60 characters total
  • Set unique titles for each entry
  • Include primary keyword near the beginning
  • Use consistent separator across the site
  • Add SEO title field for editor control
  • Test on all page types before launch

Don't

  • Hardcode titles in templates (use fields/plugins)
  • Forget to set fallbacks for missing title data
  • Use duplicate titles across entries
  • Make titles longer than 60 characters
  • Leave title empty or generic
  • Ignore SEO fields in entry type layouts

Verification Checklist

  • View page source > Search for <title>
  • Check browser tab shows expected title
  • Verify title under 60 characters total
  • Test different entry types and sections
  • Check homepage, entry, and category pages
  • Use SEOmatic preview if available

Pro Tips

  • SEOmatic can generate JSON-LD schema automatically—huge time saver
  • Use Twig conditions to create different title formats per section
  • Create a 'preview' environment to test SEO changes before production
  • Set up Craft CMS preview targets to see title in context
  • Use SEOmatic's bulk editing for fixing titles on many entries
  • Consider multilingual? SEOmatic handles hreflang too

Common Issues & Fixes

Problem: Title shows raw Twig code instead of values
Solution: Your template isn't processing correctly. Check for Twig syntax errors. Ensure you're using {{ }} for output, not {% %}. Verify the variable exists (entry is defined).
Prevention: Test templates with known data before launch.
Problem: SEOmatic fields not appearing in entries
Solution: SEOmatic uses a separate tab. Look for 'SEO' tab in the entry editor. If missing, check SEOmatic > Content SEO > enable for that section.
Prevention: Configure Content SEO settings for each section.
Problem: Duplicate titles across entries
Solution: Template is missing entry-specific variable. Ensure {{ entry.title }} or similar is used, not a hardcoded string. Check that SEO title field is being populated.
Prevention: Audit titles with a site crawler like Screaming Frog.
Problem: Title not changing after update
Solution: Clear Craft caches: Utilities > Clear Caches > All. If using template caching, clear that too. Check for static cache layers (Servd, Blitz).
Prevention: Disable caching during development.