Fix Guide

How to Add a Meta Description in WordPress

February 8, 2026

WordPress does not output a meta description tag by default. Here is how to add one to improve your search result snippets and click-through rates.

Method 1: Yoast SEO (Recommended)

  1. Install and activate Yoast SEO.
  2. Edit any post or page.
  3. In the Yoast SEO meta box below the editor, click "Edit snippet".
  4. Write your meta description in the "Meta description" field.
  5. Aim for 120-160 characters — the green bar indicates the optimal length.

Yoast also automatically generates meta descriptions from the content if you don't write one manually.

Method 2: Rank Math

  1. Install and activate Rank Math.
  2. Edit a post or page.
  3. Click the Rank Math meta box and fill in the "Description" field.

Method 3: Custom Code

Add a meta description via functions.php:

function custom_meta_description() {
    if (is_singular()) {
        $description = has_excerpt() ? get_the_excerpt() : wp_trim_words(get_the_content(), 25);
        echo '<meta name="description" content="' . esc_attr($description) . '" />' . "\n";
    } elseif (is_front_page()) {
        echo '<meta name="description" content="' . esc_attr(get_bloginfo('description')) . '" />' . "\n";
    }
}
add_action('wp_head', 'custom_meta_description', 1);

Tips for Writing Effective Meta Descriptions

  • Include a call-to-action (e.g., "Learn how...", "Discover...")
  • Include the primary keyword naturally
  • Make each description unique — no duplicates
  • Accurately describe what the user will find on the page

Verify with InspectWP

Run an InspectWP scan — the SEO section shows your meta description content and length.

Check your WordPress site now

InspectWP analyzes your WordPress site for security issues, SEO problems, GDPR compliance, and performance — for free.

Analyze your site free