Setting up Meta Tags (title, description, keywords) for a Website
Meta tags are basic SEO settings that affect how pages appear in search results. Title and description form the snippet in search results: this is what users see before clicking.
Title
Rules for a good title:
- Length 50–60 characters (Google truncates longer ones)
- Main keyword closer to the beginning
- Unique for each page
- Contains site/brand name (usually at the end via
|or—)
<title>Buy iPhone 15 Pro — official store | TechnoStore</title>
Description
- Length 150–160 characters
- Describes page content + call to action
- Unique for each page
- Doesn't directly affect rankings, but affects CTR
<meta name="description" content="iPhone 15 Pro with delivery in 1-2 days. Official 1 year warranty. Over 50 configuration options. 0% installment for 12 months.">
Keywords
Meta keywords are ignored by Google and Yandex since 2009/2014. No need to add it.
Implementation in Laravel + Blade
// config/seo.php
return [
'defaults' => [
'title' => 'Website Name',
'description' => 'Default description',
'suffix' => '| Website Name'
]
];
// layouts/app.blade.php
<title>{{ isset($seoTitle) ? "{$seoTitle} " . config('seo.defaults.suffix') : config('seo.defaults.title') }}</title>
<meta name="description" content="{{ $seoDescription ?? config('seo.defaults.description') }}">
// In product page controller
return view('products.show', [
'product' => $product,
'seoTitle' => "Buy {$product->name} — price, photos, specifications",
'seoDescription' => Str::limit("Buy {$product->name} for {$product->price} ₽. {$product->short_description}", 155)
]);
Implementation in Next.js
import Head from 'next/head';
export function SeoMeta({ title, description, children }) {
const fullTitle = title
? `${title} | ${process.env.NEXT_PUBLIC_SITE_NAME}`
: process.env.NEXT_PUBLIC_SITE_NAME;
return (
<Head>
<title>{fullTitle}</title>
<meta name="description" content={description || process.env.NEXT_PUBLIC_DEFAULT_DESCRIPTION} />
{children}
</Head>
);
}
Generating description from Content
If meta-description is not filled in manually:
public function generateDescription(string $content, int $length = 155): string
{
$text = strip_tags($content);
$text = preg_replace('/\s+/', ' ', $text);
return Str::limit(trim($text), $length);
}
Setup timeline: a few hours for basic setup with templates.







