October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Add a Meta Description in WordPress (With or Without a Plugin)

Add and verify WordPress meta descriptions with an SEO field, the block editor’s Excerpt panel, or a custom-field PHP method. Learn how to avoid duplicate tags and Google snippet surprises.
WorldWordPress Length10 min Posted Quest giverVGSources Team

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WordPress does not provide a universally available, core “Meta description” box for every post. You can still create one reliably: use a plugin’s description field if your site has one, store text in the block editor’s Excerpt panel and have your theme output it, or create a custom field named meta-description and print it through wp_head. Google may rewrite the text, so treat it as a precise suggestion rather than a guaranteed search snippet.

What a meta description does in WordPress

A meta description is text placed in the page’s HTML as <meta name="description" content="...">. It summarizes a URL for search engines and other systems that read document metadata. It is not normally visible in the page body.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Google says it mainly builds snippets from visible page content and can use the meta description when that text describes the page better. The description therefore influences how a result may be presented, but it does not force Google to display your wording. Google can truncate the displayed snippet to fit the device and can replace your description with another passage.

There is no Google-mandated character maximum. Google describes descriptions as able to run as long as needed, while the search result itself is shortened according to available screen width. The often-repeated 150–160-character target is an industry rule of thumb for writing a compact sentence, not a Google policy.

Choose the implementation that fits your site

Route What you edit What it produces by itself Best use Main caution
SEO plugin field A description field supplied by the SEO plugin Usually the plugin’s own head output Sites already using a maintained SEO plugin Field names and behavior differ; follow that plugin’s documentation and check the source for duplicates.
Block editor Excerpt The post’s Excerpt panel An excerpt value; not automatically a meta tag on every theme Editors who want a no-code text field and a theme or plugin that maps excerpts to descriptions Dynamic block content may not be captured by the_excerpt().
Custom field plus code A custom field, such as meta-description Nothing until code prints it in wp_head Sites that need a lightweight, controlled implementation without a full SEO suite Theme changes, duplicate tags, and untested code can break output; use a child theme or site-specific plugin and test on staging.

Do not combine multiple routes casually. If a plugin, theme, and custom function all emit a description, the page can contain more than one tag and it becomes unclear which value should be used. Pick one owner for the final HTML output.

Route 1: Use the WordPress Excerpt panel

The block editor exposes an Excerpt text area. WordPress documentation describes the excerpt field as a semantic description used by templates, template parts, and patterns. That makes it a useful place to maintain concise summary text, but the field alone does not guarantee a <meta name="description"> tag in the document head. Your theme or an SEO component must read the excerpt and output the tag.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enter an excerpt for a post or page

  1. Open the post or page in the WordPress block editor.
  2. Open the settings sidebar and select the Post tab (or the equivalent document tab for the content type).
  3. Expand Excerpt. The exact panel placement can vary with the WordPress version, theme, and post type.
  4. Write one specific sentence describing what the visitor will find on that URL. Put the most important subject and benefit near the beginning.
  5. Save or update the content.

Confirm that the excerpt reaches the head

Open the public URL while logged out, view the page source, and search for name="description". If no description tag exists, the excerpt is being stored but not mapped to head metadata. You then need a plugin or theme-level implementation that performs that mapping; do not assume that saving the Excerpt panel changed the HTML.

Understand the excerpt limitation

WordPress’s the_excerpt() output is not guaranteed to include content dynamically inserted by blocks. A page assembled from dynamic blocks can therefore have an excerpt that does not represent all rendered content. Review the actual source and the resulting snippet rather than relying only on the editor value.

Route 2: Add a custom field and output it with code

This route separates editorial text from the code that prints the tag. It works without a full SEO plugin, but it requires access to the editor’s custom-field panel and a safe place for PHP code.

Enable the Custom Fields panel

  1. Open a post in the block editor.
  2. Open the editor’s three-dot options menu and choose Preferences. WordPress hides the Custom Fields panel by default on installations where the option is available.
  3. In the preferences panels list, enable Custom fields, then close the dialog. Labels and panel locations can vary by WordPress release.
  4. Return to the post editor and locate the Custom Fields panel, usually below the main editing area.

Store the description value

  1. Create a new field and enter meta-description as its key. Use the same key on every post; inconsistent spelling creates missing descriptions.
  2. Enter the description as the value. Do not include HTML tags; write plain text that can be safely placed in an attribute.
  3. Save or update the post, then repeat for each URL that needs a custom description.

Print the field in the document head

The following example reads the field only on singular content views and escapes the value before output. It is an implementation example, not a substitute for testing your particular theme. Put it in a child theme’s functions.php or, preferably, a small site-specific plugin so a parent-theme update does not overwrite it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<?php
function vgsources_meta_description() {
    if ( ! is_singular() ) {
        return;
    }

    $description = get_post_meta( get_queried_object_id(), 'meta-description', true );

    if ( empty( $description ) ) {
        return;
    }

    echo '<meta name="description" content="' . esc_attr( wp_strip_all_tags( $description ) ) . '" />' . "n";
}
add_action( 'wp_head', 'vgsources_meta_description', 1 );

is_singular() limits output to an individual post, page, or other singular post type. get_queried_object_id() retrieves the ID of the URL being rendered, and get_post_meta() reads the value stored under meta-description. wp_strip_all_tags() removes accidental markup; esc_attr() protects quotation marks and other characters when the value is placed in the HTML attribute.

Test the custom-field implementation before publishing it

  1. Use a staging site or a backup before adding PHP. A syntax error can make the site unavailable until the change is removed.
  2. Open one post with a populated field and view its source. Confirm there is exactly one <meta name="description"> element and that its content matches the field.
  3. Open a post with no field. The function should output nothing, allowing another system—or no description—to handle that URL.
  4. Check a category, tag, search, or archive URL. Because the example is restricted to singular views, it should not add a tag there.
  5. Check mobile and desktop search results after Google recrawls the page. A different snippet does not necessarily mean the HTML is wrong; Google may select other text.

Prevent duplicate tags

Before enabling this function on a site with a theme or SEO plugin, inspect the source for existing description tags. Remove or disable the competing output rather than printing a second tag. The custom field should have one clearly defined output path.

Route 3: Use an SEO plugin’s description field

Many WordPress sites use an SEO plugin that adds a per-page description field and emits the corresponding head markup. Because field names, settings, and output rules differ between plugins, there is no single WordPress-wide click path to document. Open the plugin’s panel in the post editor, enter a description, save the post, and verify the rendered source as described above.

Do not add the custom-field function as well unless you have confirmed that the plugin does not already output a description. If the plugin supports templates or fallbacks, use those deliberately: a fallback can prevent empty tags, but a generic template repeated across many URLs conflicts with Google’s preference for specific descriptions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Write a description that earns the available snippet space

Describe the exact URL

State what the page contains and why it is useful. A guide should identify the task and the outcome; a game page should identify the game, platform, or feature covered; a news item should name the event or update. Avoid vague wording such as “Welcome to our website” that could apply to every page.

Make each URL’s text distinct

Google advises against duplicated descriptions. Reusing the same sentence on every post removes information that could help a searcher distinguish results. If two pages are genuinely near-duplicates, consider whether both need to be indexable instead of disguising the duplication with minor wording changes.

Use a concise sentence, not a character promise

Keep the key information early because the visible snippet may be cut off at different widths. The 150–160-character convention can help you draft a compact sentence, but it is not a fixed limit and longer descriptions are not automatically invalid. Remove filler, repeated keywords, and claims the page does not support.

Match the page and its visible content

A description that promises a download, feature, date, or answer absent from the page is misleading. Since Google often builds snippets from page content, an accurate description that aligns with the page gives the search engine a better candidate than marketing copy unrelated to the document.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not treat it as a direct ranking control

An older Google statement says accurate descriptions can improve click-through while not affecting ranking. The practical objective is therefore better result communication and qualified visits, not a guaranteed position increase. Google can still choose a different passage.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the finished tag

Check the raw HTML

  1. Open the public URL in a private window.
  2. Use the browser’s View Source command, not only the visual inspector.
  3. Search for <meta name="description".
  4. Confirm the tag appears inside <head>, has one content value, and contains the intended text.
  5. Search again to ensure a second description tag is not present.

Check different content states

  • A published post with a custom value should show that value.
  • A post without a value should follow your chosen fallback policy rather than receiving an accidental empty tag.
  • Pages, custom post types, archives, and the front page may use different templates and hooks.
  • Cached HTML can conceal a change; purge the relevant page cache and recheck source.

Separate implementation from search appearance

If the source contains the correct tag but a search result shows different wording, the implementation is still functioning. Google chooses snippets itself, may use visible page text instead, and truncates display to fit the device. Search changes also require recrawling, so they are not an immediate test of whether the PHP or editor value was saved.

Troubleshoot common failures

Symptom Likely cause Fix
No description tag in source The Excerpt or custom field is stored but no component outputs it, or the code is not loading. Confirm the correct template is active, check the code location, and use one verified output method.
Two description tags A theme, plugin, and custom function are all emitting metadata. Choose one owner and disable the other output.
Text is blank The field key differs from meta-description, the value was not saved, or the code is reading the wrong post ID. Compare the key character-for-character, update the post, and test the URL’s source.
HTML appears inside the description Markup was entered into the field or was not stripped before output. Store plain text and sanitize before escaping, as in the example.
Excerpt does not reflect a block-built page Dynamic block content is not included by the_excerpt(). Write an intentional excerpt manually or use a dedicated description field.
Search shows different wording Google selected visible content or rewrote the snippet. Make the description accurate and aligned with the page; do not add a second tag to force the wording.
Code disappears after a theme update The code was placed directly in a parent theme. Move it to a child theme or site-specific plugin and retest.

Decide how to handle pages without a custom description

A site can leave some URLs without a manually written description. Google can generate a snippet from the page, and a plugin or theme may provide a fallback. The important choice is consistency: document which content types require editorial text, which receive a template, and which are intentionally left to Google. Avoid generating the same generic sentence for every page merely to fill the tag.

For singular content, the custom-field example intentionally emits nothing when the field is empty. That behavior avoids an empty attribute and lets the site’s existing system handle the omission. If you change that policy, test the fallback source and confirm that it does not create duplicate tags.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Maintenance checklist

  • Use one output method per URL.
  • Keep the editorial text specific to the page.
  • Use the Excerpt panel only when your theme or plugin actually maps it to head metadata.
  • If using custom fields, keep the key exactly meta-description (or change both storage and code together).
  • Place PHP in a child theme or site-specific plugin, not a parent theme.
  • Escape values before placing them in HTML attributes.
  • Check source for exactly one description tag after theme or plugin changes.
  • Expect Google to shorten or replace the displayed snippet.

The dependable workflow is simple: choose one source of truth, make its text unique and accurate, verify the rendered HTML, and then judge search appearance separately from implementation. WordPress can store the text in an excerpt or custom field, but only the final head output—and Google’s independent snippet selection—determines what a searcher may see.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.