How to Add Meta Tags in WordPress (4 Ways, With and Without a Plugin)
How to add meta tags in WordPress: which tags actually matter in 2026, the fastest plugin way with Rank Math or Yoast, and how to do it without a plugin.

To add meta tags in WordPress, install an SEO plugin like Rank Math or Yoast, open any post, and fill the SEO title and meta description fields. The plugin writes the tags into your page head for you. Prefer no plugin? Add a code snippet with WPCode or in your child theme's functions.php. Focus on the meta title, meta description, robots, and Open Graph tags. Skip meta keywords entirely, Google has ignored them since 2009.
On this page
- TL;DR
- Which meta tags actually matter in WordPress?
- The fastest way: an SEO plugin
- Add meta tags with Rank Math
- Add meta tags with Yoast SEO
- How do I add meta tags without a plugin?
- Use a code snippet with WPCode
- Edit your child theme's functions.php
- Should I add meta keywords in WordPress?
- How do I check my meta tags are working?
- Final take
- Common questions
A fresh WordPress site ships with almost no meta tags.
It sets a page title and nothing else, so your search snippets read however Google decides to guess them.
Meta tags are how you take that control back. They tell search engines and social platforms what each page is, in your words.
I have set these up on more sites than I can count, and the job takes minutes.
The catch is that half the tags people worry about do not matter, and the one that gets searched most is dead. Let me sort that out first, then show you four ways to add the ones that count.
Which meta tags actually matter in WordPress?
Before touching a plugin, know what you are setting.
Only a handful of meta tags earn their place. The rest are noise.

- Meta title: the clickable headline in search results. Your single biggest on-page lever for relevance and clicks.
- Meta description: the snippet under the title. Not a ranking factor, but a sharp one wins the click. Keep it 120 to 160 characters.
- Robots meta: controls indexing. Use
noindexon thank-you and login pages you want kept out of Google. The same family of controls decides what AI crawlers can do with your pages. - Open Graph:
og:title,og:imageand the rest decide how your page looks when shared on Facebook or LinkedIn. A good plugin fills these for you.
The one to ignore is meta keywords. Google confirmed back in 2009 that it does not use it, and it is the most-searched meta tag of the lot. Filling it wastes time and quietly shows competitors the exact terms you are chasing.
The fastest way: an SEO plugin
For nearly every site, a plugin is the right answer. It adds a simple SEO box to every post where you type a title and description, then writes all the tags, including Open Graph, into your page head automatically.
No code, no theme files, and you get a live preview of the snippet before it goes out.
Here are the four ways to add meta tags, from easiest to most hands-on.
| Method | Best for | Plugin? |
|---|---|---|
| Rank Math | Most sites (my default) | Yes |
| Yoast SEO | The long-established standard | Yes |
| WPCode snippet | No SEO plugin, still no code editing | Yes (code plugin) |
| functions.php | Developers, child theme only | No |
Method 1
Add meta tags with Rank Math
Best for: Most sites — most free features
Rank Math is the one I reach for first. It is light, and it gives away more on the free tier than the others, including automatic Open Graph and Twitter card tags. If even Rank Math feels like too much plugin, I have compared it with Slim SEO, a leaner option that also writes these tags.

Step 1
Install and run the setup wizard
Go to Plugins, Add New, search "Rank Math SEO", install and activate. Run its short setup wizard once so the defaults are sensible.
Step 2
Open the SEO box on a post
Edit any post or page and open the Rank Math panel (the score button in the top bar, or the box below the editor).
Step 3
Fill the title and description, then update
Type your SEO Title and Meta Description. Use the Advanced tab for robots options like noindex. Update the post and the tags go live.
Method 2
Add meta tags with Yoast SEO
Best for: The established, most-installed option
Yoast SEO is the oldest and most-installed SEO plugin, and it handles meta tags exactly as well as Rank Math.
If you already run Yoast, there is no reason to switch.
Edit a post and scroll to the Yoast SEO box (or open it from the top bar). Under Search appearance you get a live Google preview with the SEO title and Meta description fields right below it.

Type your title and description, watch the preview update, and save. Yoast writes the meta tags plus Open Graph for you. It is the same job as Rank Math, just a different box.
How do I add meta tags without a plugin?
This is a real and common search, usually from people who do not want another plugin slowing the site.
It is doable. But here is the honest caveat.
Without a plugin you lose the per-post fields and the live previews, so you are setting things more crudely.
Method 3
Use a code snippet with WPCode
Best for: No SEO plugin, but no file editing either
WPCode lets you add PHP safely from the dashboard, with no theme file editing. Go to Code Snippets, Add Snippet, choose a PHP snippet, and paste something like this:
function tgx_meta_description() {
if ( is_singular() ) {
$description = wp_strip_all_tags( get_the_excerpt() );
if ( $description ) {
echo '<meta name="description" content="' . esc_attr( $description ) . '">' . "\n";
}
}
}
add_action( 'wp_head', 'tgx_meta_description' );Set it to run everywhere and activate. It prints a meta description from each post's excerpt, so fill in your excerpts for it to work.
Method 4
Edit your child theme's functions.php
Best for: Developers comfortable with code
The same snippet can go straight into your theme's functions.php via Appearance, Theme File Editor. Two firm rules before you do.
Only ever edit a child theme. Code added to a parent theme's functions.php is wiped on the next theme update. Back up first, because a stray character here can white-screen the whole site.
For most people WPCode is the safer version of this exact method. Reach for direct file editing only if you already work this way.
Should I add meta keywords in WordPress?
Short answer: no. This gets searched a lot, so it is worth being blunt about.
Google publicly confirmed in 2009 that it does not use the keywords meta tag for ranking, and that has not changed since. Bing treats a stuffed keywords tag as a spam signal, not a help.
So filling it does nothing for you, and it does one thing against you: anyone can read your page source and see the exact terms you are targeting.
Leave it empty. Put that effort into a strong title and description instead.
How do I check my meta tags are working?
Do not assume, verify. It takes thirty seconds.
Open the live page, right-click and choose View Page Source, then search (Ctrl/Cmd + F) for description or og:.
You should see one <meta name="description"> line and your Open Graph tags in the <head>. If you see two descriptions, you are probably running two SEO plugins at once or a theme is also printing one. Remove the duplicate, because conflicting tags confuse crawlers.
For the social side, paste the URL into a sharing debugger (the ones from Facebook or LinkedIn) to see the Open Graph title and image render exactly as visitors will.
Meta tags set, but the pages still are not ranking?
Titles and descriptions are the easy part. If your WordPress site is not showing up the way it should, the cause is usually deeper, indexation, canonicalization or site speed. I can find what is actually holding it back.
See technical SEOFinal take
Adding meta tags in WordPress is a short job with an outsized payoff. Set a clear meta title and meta description on every important page, use robots to keep junk pages out of the index, and let a plugin handle Open Graph so your shares look right.
The plugin route (Rank Math or Yoast) is the right call for almost everyone; the code methods exist for when you genuinely cannot add one.
Whatever you do, skip meta keywords, and check your source once to confirm the tags are really there.
Common questions
Does WordPress add meta tags automatically?
WordPress adds a basic title tag on its own, but it does not add a meta description or Open Graph tags by default. For those you need an SEO plugin or a code snippet. That is why a fresh WordPress site has no proper meta description until you set one.
How do I add a meta description in WordPress without a plugin?
Add a small snippet to your child theme's functions.php, or use a code plugin like WPCode, that hooks into wp_head and prints a meta description from each post's excerpt. It works, but you lose the per-post control and previews a real SEO plugin gives you.
Should I add meta keywords in WordPress?
No. Google confirmed in 2009 that it ignores the keywords meta tag for ranking, and Bing treats stuffing it as a spam signal. Filling it does nothing useful and can hand your target keywords to competitors reading your source. Spend the time on the title and description instead.
What is the ideal meta description length?
Keep it between 120 and 160 characters. Google truncates longer descriptions in the results, so the important part should come first. Write it for a human deciding whether to click, not for a keyword count, and make each page's description unique.
Can I set different meta tags for every page?
Yes. Every method here supports unique titles and descriptions per post and page. With Rank Math or Yoast you set them in the SEO box on each post. That per-page control is the main reason a plugin beats a single site-wide code snippet.
Rank Math or Yoast, which is better for meta tags?
Both do the job well and work almost identically for titles and descriptions. Rank Math gives more away on its free tier and is lighter; Yoast is the long-established default with the biggest install base. Pick one, never run both, as two SEO plugins output duplicate tags.

SEO Specialist and product builder with 10+ years in search. The notes come from the work, not the theory.