Estimated reading time: 13 minutes
Meta tags are HTML snippets in your site’s <head> section that tell search engines and social platforms what your pages are about. You can add meta tags in WordPress using an SEO plugin like Yoast SEO or Rank Math, or by manually editing your theme files.
WordPress doesn’t generate meta descriptions by default, which means Google is left guessing what text to show in your search snippet. Meta tags also control how your content looks when shared on social media and whether search crawlers index specific pages. Getting them right won’t magically boost rankings, but it can increase the number of people who click your results.
This guide covers what each meta tag type does, how to add them with a plugin or code, and how to verify they’re working.
Table of contents
What Are Meta Tags in WordPress?
Meta tags are HTML elements placed inside the <head> section of a web page. Visitors don’t see them when browsing your site, but search engines and social media platforms read them to understand what your content is about and how to display it.
A fresh WordPress installation generates basic title tags and a few technical meta tags automatically. However, it does not create meta descriptions, Open Graph tags for social sharing, or keyword meta tags. This is intentional. Meta descriptions need to be unique to each page, and WordPress can’t generate meaningful summaries of content that doesn’t exist yet. That’s your job, or your SEO plugin’s job.
You might be wondering about meta keywords. Google confirmed in 2009 that it does not use the meta keywords tag for ranking. Bing has also downplayed its importance. Every major WordPress SEO plugin disables meta keywords by default for this reason. Don’t spend time on them.
What meta tags do control comes down to three areas: how your pages appear in search engine results pages (SERPs), how your content looks when shared on social media, and how crawlers interact with your pages.
Types of Meta Tags That Matter for WordPress
Not all meta tags serve the same purpose. Here are the types you’ll actually configure:
Title tag is the clickable headline that appears in search results. WordPress generates a basic title from your post title and site name, but SEO plugins let you customize it for each page. Title tags are a direct ranking factor.
Meta description is the short summary (roughly 155 characters) shown below the title in search results. It doesn’t directly affect rankings, but it heavily influences your click-through rate (CTR). WordPress does not auto-generate meta descriptions. If you don’t write one, Google will pull whatever text it finds on the page.
Robots meta tag tells search engines whether to index a page and whether to follow its links. Common directives include noindex (don’t show this page in search results) and nofollow (don’t pass link equity through this page’s links). WordPress includes a site-wide option under Settings → Reading, but per-page control requires a plugin.
Open Graph tags control how your content appears when someone shares it on Facebook, LinkedIn, and other social platforms. They define the title, description, and image for the social preview. Without them, social platforms guess what to display, and they often guess wrong.
Twitter Card tags work like Open Graph tags but are specific to X (formerly Twitter). Most SEO plugins handle both Open Graph and Twitter Cards together.
WordPress also handles a few meta-level tags on its own, canonical tags (since version 5.7) and viewport tags (via your theme), so you don’t need to configure those manually.
For more on structured data, see our guide on how to add rich snippets in WordPress.
Here’s a quick reference:
| Meta Tag | What It Controls | SEO Impact | Added by WordPress? |
|---|---|---|---|
| Title tag | Search result headline | High (direct ranking factor) | Yes (basic) |
| Meta description | Search result snippet text | Indirect (affects CTR) | No |
| Robots | Indexing and crawling behavior | High (controls visibility) | Partial (site-wide only) |
| Open Graph | Social share appearance | Indirect (social traffic) | No |
| Twitter Cards | X/Twitter share appearance | Indirect (social traffic) | No |
| Canonical | Preferred URL version | High (duplicate content) | Yes (since WP 5.7) |
| Viewport | Mobile display/responsive | Indirect (Core Web Vitals) | Yes (via theme) |
How to Add Meta Tags in WordPress Using a Plugin (Recommended)
An SEO plugin is the easiest way to add and manage meta tags in WordPress. Plugins give you per-page control over meta descriptions, title tags, Open Graph data, and robots directives without writing a single line of code. They also generate sensible defaults for pages you haven’t manually optimized yet.
The three most popular options are Yoast SEO, Rank Math, and All in One SEO (AIOSEO). All three handle the core meta tag types covered above, and the workflow for adding meta tags is similar across each plugin. The differences come down to free-tier features, interface design, and pricing for multiple sites.
| Feature | Yoast SEO (Free) | Rank Math (Free) | AIOSEO (Free) |
|---|---|---|---|
| Focus keywords per post | 1 | 5 | 1 |
| Open Graph tags | Yes | Yes | Yes |
| Twitter Card tags | Yes | Yes | Yes |
| Robots (noindex/nofollow) | Yes | Yes | Yes |
| Schema markup types | Basic | 18+ types | Basic |
| Snippet preview | Yes | Yes | Yes |
| Redirect manager | No (Premium) | Yes | No (Pro) |
| Content analysis | Readability + SEO | SEO scoring | TruSEO (0–100) |
Rank Math offers the most features in its free version, including 5 focus keywords per post, a redirect manager, and Google Search Console integration. Yoast SEO has the largest user community (12 million+ installations) and the most third-party tutorials. AIOSEO’s per-site pricing is competitive for agencies managing multiple WordPress sites, and its TruSEO scoring system provides granular 0–100 optimization feedback.
We’ll use Yoast SEO for the walkthrough below since it’s the most widely used, but the process is nearly identical in Rank Math and AIOSEO, you’ll find the same fields (SEO title, meta description, social tags, robots settings) in each plugin’s meta box or sidebar panel.
Step-by-Step: Adding Meta Tags with an SEO Plugin
Here’s how to add meta tags using Yoast SEO. If you’re using Rank Math or AIOSEO, look for the equivalent fields in their respective settings panels.
Adding meta tags to individual posts and pages
- Install and activate Yoast SEO from Plugins → Add New.
- Open the post or page you want to optimize in the WordPress block editor.
- Scroll down below the content area to the Yoast SEO meta box.
- Enter your focus keyphrase, the keyword you want this page to rank for. Yoast will analyze your content against this keyword and provide optimization suggestions.
- Click the SEO title field to customize your title tag. You’ll see variables like %%title%% and %%sitename%% that auto-populate. You can mix these with custom text.
- Write your meta description in the description field. Yoast shows a character counter and a snippet preview so you can see how the page will look in Google.
Pro Tip: Keep descriptions under 155 characters and include your target keyword. Google often bolds matching terms in the snippet. Write for the person searching, not the algorithm: describe what they’ll get by clicking.
- Check the snippet preview at the top of the meta box. It shows both desktop and mobile versions of your search result.

Setting default meta tag templates
Navigate to Yoast SEO → Settings → Content Types. Here you can define default templates for SEO titles and meta descriptions across all posts, pages, and custom post types. These templates use variables (like the post title, category, and site name) to auto-generate meta tags for any page you haven’t manually customized. This is especially useful for large sites where you can’t write individual descriptions for every page.
Social and robots tags: Yoast enables Open Graph tags by default (verify under Yoast SEO → Settings → Social sharing). For individual posts, click the Social tab in the Yoast meta box to customize social share previews. The Advanced tab controls robots directives, set “Allow search engines to show this page in search results?” to “No” for pages you want hidden from Google, like thank-you pages.
Homepage meta tags: Go to Yoast SEO → Settings → Content Types → Homepage to set a custom SEO title and meta description for your home page.
Note for Rank Math and AIOSEO users: In Rank Math, the SEO panel lives in the block editor sidebar (click the Rank Math icon in the top-right corner). Default templates are under Rank Math → Titles & Meta. In AIOSEO, the settings box appears below the editor, and the setup wizard configures your homepage meta tags during installation. Both plugins include Social and Advanced tabs for Open Graph and robots controls, just like Yoast.
How to Add Meta Tags in WordPress Manually (Without a Plugin)
If you prefer a lightweight setup or just need to add specific tags (like a site verification tag or custom robots directive), you can add meta tags to WordPress without a full SEO plugin.
Important: Don’t combine a plugin method with manual meta tags for the same tag types. Running Yoast SEO while also manually inserting meta descriptions in your theme creates duplicate tags, which confuse search engines and social platforms.
Using a Code Snippets Plugin (Safer Approach)
The safest way to add custom meta tags without a full SEO plugin is through a code snippets tool like WPCode (formerly Insert Headers and Footers). It lets you add code to your site’s <head> section without editing theme files directly, so your changes survive theme updates.
After installing WPCode, navigate to Code Snippets → Header & Footer. Paste your meta tag HTML into the Header box. For example, to add a meta description to your homepage:
<meta name="description" content="Your homepage description goes here." />
For more control (like adding different meta tags to different pages), you can use WordPress’s wp_head action hook in a custom code snippet:
add_action( 'wp_head', 'custom_meta_tags' );
function custom_meta_tags() {
if ( is_front_page() ) {
echo '<meta name="description" content="Your homepage description here." />' . "\n";
}
if ( is_single() || is_page() ) {
// Dynamic descriptions could be built from post excerpts or custom fields
global $post;
$excerpt = wp_strip_all_tags( get_the_excerpt( $post ) );
echo '<meta name="description" content="' . esc_attr( $excerpt ) . '" />' . "\n";
}
}
This approach gives you programmatic control through the wp_head hook while keeping your code in a manageable location.
For more details on how this file works, see our guide on the WordPress functions.php file.
Editing Theme Files Directly (Advanced)
You can also add meta tags by editing your theme’s header.php file, but this approach has drawbacks: theme updates overwrite your changes, mistakes can break your site, and tags apply site-wide without conditional logic. If you go this route, always work in a WordPress child theme to preserve changes through updates. Open header.php, find the <head> section, and add your meta tags there.
For most WordPress site owners, the plugin method or the WPCode approach is a better choice.
How to Verify Your Meta Tags Are Working
After adding meta tags, you should check that they’re actually appearing in your page’s HTML and being read correctly by search engines and social platforms.
View Page Source: Right-click on your page and select “View Page Source” (Ctrl+U / Cmd+U). Search for <meta in the source code. Your meta description, Open Graph tags, and robots directives should appear inside the <head> section.
Browser Developer Tools: Right-click → “Inspect” → Elements tab. Expand the <head> element to see all meta tags. This shows rendered HTML, which is useful if tags are injected dynamically by a plugin.
Google Search Console: Use the URL Inspection tool to see how Google reads your page. It shows the page title, meta description, and indexing status. If you just added or changed meta tags, you can request a recrawl to speed up the update.
Facebook Sharing Debugger: Visit developers.facebook.com/tools/debug and enter your URL to preview how Facebook reads your Open Graph tags. This tool also lets you clear Facebook’s cache if your social preview is showing old information.
Twitter Card Validator: Use the Cards Validator to test how your page appears when shared on X/Twitter. It shows the card type, title, description, and image.
Pro Tip: If you recently switched from one SEO plugin to another (for example, from Yoast to Rank Math), check for duplicate meta tags. Two plugins both outputting <meta name=”description”> tags will confuse search engines. Deactivate the old plugin completely before activating the new one. Most SEO plugins include import tools that carry your existing meta data over.
Common Meta Tag Mistakes to Avoid
Even with the right tools, a few common mistakes can undermine your meta tag setup.
Spending time on meta keywords. Google has not used the meta keywords tag for ranking since 2009. Every major SEO plugin disables this feature by default. Don’t bother.
Duplicate meta descriptions across pages. Every page needs a unique description. Using the same one across multiple pages makes it impossible for search engines to distinguish them, and users see the same generic text for every result.
Leaving meta descriptions blank. Since WordPress doesn’t generate them by default, pages without a plugin or custom code have no description tag. Google will guess, and it often guesses poorly.
Exceeding character limits. Keep title tags under 60 characters and meta descriptions under 155. Longer versions get truncated, making your listing look incomplete.
Running multiple SEO plugins. Yoast and Rank Math running simultaneously creates duplicate, conflicting meta tags. Pick one plugin. All three major options include import tools for migrating settings.
Forgetting Open Graph tags. Without them, social platforms guess what to display when someone shares your content. The result is usually a broken preview with the wrong image or a generic description.
Frequently Asked Questions
Partially. WordPress generates basic title tags, canonical URLs, and viewport tags by default. However, it does not create meta descriptions, Open Graph tags, or meta keywords. For those, you need an SEO plugin or custom code.
The three most popular choices are Yoast SEO, Rank Math, and All in One SEO (AIOSEO). Rank Math offers the most features in its free version, including 5 focus keywords per post and built-in schema markup. Yoast SEO has the largest user community and the most third-party documentation. AIOSEO is a strong option for agencies managing multiple sites thanks to its competitive multi-site pricing.
Aim for 150–155 characters. Google technically measures by pixel width rather than character count, but 155 characters is a safe guideline that prevents truncation in most search results. Mobile results may show slightly fewer characters, so front-load the most important information at the beginning of your description.
Yes. You can add meta tags manually by editing your theme’s header.php file, using the wp_head action hook in functions.php, or using a code snippets plugin like WPCode. The code snippets approach is the safest because changes survive theme updates. However, for most site owners, a full SEO plugin is the better option because it provides per-page control, snippet previews, and content analysis tools.
The easiest way is through an SEO plugin. Yoast SEO, Rank Math, and AIOSEO all add Open Graph tags automatically when activated. To customize the social title, description, and image for a specific post, open the plugin’s Social tab in the post editor. The Open Graph protocol defines four required properties: og:title, og:type, og:url, and og:image.
Wrapping Up
Meta tags give you control over how your WordPress site appears in search results and social shares. Here are the key takeaways:
- Use an SEO plugin like Yoast SEO, Rank Math, or AIOSEO to manage meta tags without code. All three handle meta descriptions, title tags, Open Graph, Twitter Cards, and robots directives.
- Write unique meta descriptions for every important page. Keep them under 155 characters, include your target keyword, and describe what the reader will find.
- Skip meta keywords entirely. Google hasn’t used them since 2009.
- Verify your tags using View Page Source, Google Search Console, and social debugging tools. Don’t assume they’re working just because you filled in a plugin field.
- Avoid duplicate tags by using only one SEO plugin at a time.
For a deeper look at optimizing your WordPress site, check out our complete guide to WordPress SEO and our roundup of the best WordPress plugins for every use case.


