You can add Meta Title & Meta Description in WordPress WITHOUT any plugin in multiple ways. Below is a complete, all-methods guide from beginner to advanced, including SEO impact, limitations, and when to use which method
METHOD 1: Edit header.php (Basic & Manual)
Best for:
-
Small websites
-
Static pages
-
When you want full manual control
Steps:
-
Go to Dashboard → Appearance → Theme File Editor
-
Open header.php
-
Inside
<head>tag, add:
<title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>
<meta name="description" content="Your website meta description here">
Limitation:
-
Same meta description for all pages
-
Not SEO-friendly for large sites
METHOD 2: Use functions.php (Dynamic & SEO Friendly)
Best for:
-
Blogs
-
Service websites
-
SEO-optimized sites without plugins
Steps:
-
Go to Appearance → Theme File Editor
-
Open functions.php
-
Add this code:
add_theme_support('title-tag');
function custom_meta_description() {
if (is_single() || is_page()) {
global $post;
$meta = wp_strip_all_tags(get_the_excerpt($post->ID));
echo ‘<meta name=”description” content=”‘ . $meta . ‘”>’ . “\n”;
}
}
add_action(‘wp_head’, ‘custom_meta_description’);
Result:
-
Meta title auto-handled by WordPress
-
Meta description pulled from page excerpt
METHOD 3: Use Page Excerpt (Smart & Clean)
Best for:
-
Bloggers
-
Content websites
Steps:
-
Edit any Page/Post
-
Enable Excerpt from Screen Options
-
Write a custom excerpt
-
Add this in
functions.php:
function meta_desc_from_excerpt() {
if (is_singular()) {
echo '<meta name="description" content="' . get_the_excerpt() . '">';
}
}
add_action('wp_head', 'meta_desc_from_excerpt');
- Each page gets unique meta description
- Google-friendly
METHOD 4: Hardcode Meta for Individual Pages (Landing Pages)
Best for:
-
Sales pages
-
Landing pages
-
PPC pages
Steps:
Edit page template (example: page-services.php):
<head>
<title>SEO Services in Ireland | Your Brand</title>
<meta name="description" content="Professional SEO services in Ireland to increase traffic and leads.">
</head>
- Perfect control
- Not scalable
METHOD 5: Custom Fields (Advanced & Professional)
Best for:
-
SEO-focused websites
-
Agencies
-
Custom WordPress builds
Step 1: Add Custom Fields
Add two fields:
-
meta_title -
meta_description
Step 2: Add Code in functions.php
function custom_meta_tags() {
if (is_singular()) {
global $post;$meta_title = get_post_meta($post->ID, ‘meta_title’, true);$meta_desc = get_post_meta($post->ID, ‘meta_description’, true);
if ($meta_title) {echo “<title>$meta_title</title>”;
}
if ($meta_desc) {echo “<meta name=’description’ content=’$meta_desc‘>”;
}
}
}
add_action(‘wp_head’, ‘custom_meta_tags’, 1);
- Same power as the SEO plugin
- Fully manual but scalable
METHOD 6: Use wp_title Filter (Old Themes)
add_filter('wp_title', function($title) {
if (is_page('services')) {
return 'SEO Services in Ireland | Brand Name';
}
return $title;
});
Not recommended for new themes
METHOD 7: Auto Meta from Content (Fallback Method)
function auto_meta_description() {
if (is_singular()) {
global $post;
$content = wp_strip_all_tags($post->post_content);
echo '<meta name="description" content="' . substr($content, 0, 155) . '">';
}
}
add_action('wp_head', 'auto_meta_description');
No manual work
Less optimized
META TITLE WITHOUT PLUGIN (Best Practice)
WordPress (v4.4+) supports automatic meta title if theme has:
add_theme_support('title-tag');
Then WordPress auto-generates:
Page Title | Site Name
IMPORTANT SEO WARNINGS
Do NOT add multiple <title> tags
Avoid duplicate meta descriptions
Use child theme (updates overwrite code)
WHICH METHOD SHOULD YOU USE?
| Website Type | Best Method |
|---|---|
| Small website | header.php |
| Blog | Excerpt method |
| Service pages | Custom fields |
| Landing pages | Hardcoded |
| Agency site | Custom fields (Method 5) |
