How to Add Meta Keywords in WordPress Without a Plugin (and Whether You Should)
If you searched for how to add meta keywords in WordPress without a plugin, you probably expect a quick code snippet — and you’ll get one. But before you paste anything into your theme, there’s a caveat worth understanding: the meta keywords tag is obsolete for search engine optimization. Google has openly ignored it for well over a decade, and stuffing it with terms can actually hand your keyword strategy to competitors who view your page source.
This guide does two things. First, it explains *why* the meta keywords tag is a dead end for ranking, so you can make an informed decision. Second, it shows you exactly how to add one without any plugin — for the rare legacy or system-specific cases where you genuinely need it — and, more importantly, how to add the meta description tag, which still matters.
Key Takeaways
• The meta keywords tag is ignored by Google and most modern search engines; adding it will not improve your rankings.
• Exposing a long keyword list in your page source can reveal your strategy to competitors with zero upside.
• You can add it without a plugin via a `wp_head` hook in your child theme’s `functions.php`, but only do so if a specific internal search, intranet, or non-Google engine requires it.
• Spend your effort on the tags that *do* matter today: the title tag, meta description, and Open Graph tags.
Does the meta keywords tag still do anything for SEO?
In short: no. The `` tag was a 1990s mechanism that let webmasters declare what their page was “about.” It was abused so heavily — pages stuffed with hundreds of irrelevant terms — that search engines stopped trusting it. Google confirmed years ago that it does not use the meta keywords tag in web ranking, and the major engines that drive global traffic follow suit.
There are two practical reasons to avoid it:
- No ranking benefit. Filling in keywords does nothing for your position in search results. Your effort is better spent elsewhere.
- Competitive exposure. Because the tag sits in your public HTML, anyone can open “View Source” and read your exact target keywords. You are essentially publishing your strategy for free.
The honest, often-unspoken truth: the meta keywords tag is SEO-dead. Google ignores it entirely, so every minute you spend curating a keyword list is a minute not spent on your title tag, meta description, and the actual content on the page — the three things that genuinely move rankings. Add the keywords tag without a plugin *only* if a specific downstream system (an internal search index, a niche directory, or a client requirement) explicitly demands it. Otherwise, skip it.
When might you still legitimately need it?
A few narrow scenarios justify adding the tag:
- Internal site search tools or on-site search plugins that read the keywords meta to improve their own results.
- A specific non-Google search engine or regional engine that still parses the field.
- Compliance or client mandates — sometimes a brand guideline or third-party integration requires the field to be populated, even if it does nothing for Google.
If none of those apply to you, you can stop reading here and jump to the section on meta tags that matter.
Which meta tags actually matter today?
Before adding anything, it helps to see where the keywords tag sits relative to tags that earn real results. Here is a clear comparison.
| Meta tag | Does it affect Google ranking? | Does it affect what users see? | Worth your time? |
|---|---|---|---|
| Title tag (` |
Yes — a strong relevance signal | Yes — it’s the clickable headline in results | Essential |
| Meta description | Not a direct ranking factor | Yes — drives click-through from the snippet | High |
| Open Graph (`og:title`, `og:image`) | No direct ranking effect | Yes — controls social share previews | High |
| Meta keywords | No — ignored by Google | No — invisible to users | Skip (unless a system requires it) |
| Meta robots (`noindex`, `nofollow`) | Yes — controls crawling/indexing | No | Situational but important |
The pattern is clear: focus your energy on the title, description, and Open Graph tags. They influence whether people find and click your page.
How do you add a meta keywords tag in WordPress without a plugin?
The cleanest no-plugin method is to hook into `wp_head` from your child theme’s `functions.php`. Always use a child theme so your edits survive theme updates.
Option 1: A static keywords tag for the whole site
This adds the same keywords to every page. Useful only for very small or single-topic sites.
“`php // In your child theme’s functions.php function dh_add_static_meta_keywords() { echo ‘‘ . “\n”; } add_action( ‘wp_head’, ‘dh_add_static_meta_keywords’ ); “`
Option 2: Pull keywords from the post’s tags
This is more dynamic — it builds the keywords list from each post’s assigned tags, so different pages get relevant terms automatically.
“`php // In your child theme’s functions.php function dh_add_dynamic_meta_keywords() { if ( is_single() ) { $tags = get_the_tags(); if ( $tags ) { $keywords = array(); foreach ( $tags as $tag ) { $keywords[] = esc_attr( $tag->name ); } echo ‘‘ . “\n”; } } } add_action( ‘wp_head’, ‘dh_add_dynamic_meta_keywords’ ); “`
Option 3: Pull keywords from a custom field
If you want manual control per post, store keywords in a custom field (for example, named `meta_keywords`) and echo it.
“`php // In your child theme’s functions.php function dh_add_custom_field_keywords() { if ( is_singular() ) { $keywords = get_post_meta( get_the_ID(), ‘meta_keywords’, true ); if ( ! empty( $keywords ) ) { echo ‘‘ . “\n”; } } } add_action( ‘wp_head’, ‘dh_add_custom_field_keywords’ ); “`
Note the use of `esc_attr()` in each example — always escape output to prevent broken markup or security issues.
How do you add a meta description without a plugin (the tag that actually helps)?
This is the part worth your attention. The meta description doesn’t directly raise rankings, but it controls the snippet text in search results and strongly influences click-through rate. Here’s how to add it dynamically using a custom field, falling back to an auto-generated excerpt.
“`php // In your child theme’s functions.php function dh_add_meta_description() { if ( is_singular() ) { $description = get_post_meta( get_the_ID(), ‘meta_description’, true );
// Fall back to the post excerpt if no custom description is set. if ( empty( $description ) ) { $description = wp_strip_all_tags( get_the_excerpt() ); }
if ( ! empty( $description ) ) { $description = esc_attr( wp_trim_words( $description, 30, ” ) ); echo ‘‘ . “\n”; } } } add_action( ‘wp_head’, ‘dh_add_meta_description’ ); “`
You can use the same `wp_head` approach to add Open Graph tags for clean social sharing previews:
“`php function dh_add_open_graph_tags() { if ( is_singular() ) { echo ‘‘ . “\n”; echo ‘‘ . “\n”; echo ‘‘ . “\n”; } } add_action( ‘wp_head’, ‘dh_add_open_graph_tags’ ); “`
Editing the theme header.php directly
If you prefer not to use a hook, you can place static meta tags directly inside the `
` section of your child theme’s `header.php`, before the closing `` tag. The `wp_head` approach is generally cleaner because it keeps your additions organized and avoids editing core template structure, but both are valid.“`php
“`
A practical reminder: editing `functions.php` is unforgiving — a single missing semicolon or stray character can produce the dreaded “white screen of death.” Always edit on a staging site first, or keep a backup of the file so you can revert quickly.
Why your hosting environment makes theme edits safer
Editing `functions.php` and managing child themes is far less stressful when your hosting gives you fast, direct file access and a safety net to test changes.
DarazHost provides WordPress-friendly hosting built for exactly this kind of work. You get easy file access through cPanel’s File Manager and SFTP, so editing `functions.php` or uploading a child theme takes seconds — no clunky workarounds. Our staging environments let you test code changes safely before they ever touch your live site, which is invaluable when a typo can take a page down. And because fast hosting genuinely supports SEO — page speed is a real ranking and user-experience signal — you’re improving the metrics that actually matter while you skip the ones that don’t. If something goes sideways, our 24/7 support team is available to help you recover.
What should you focus on instead of meta keywords?
If your goal is better search visibility, redirect the effort you’d spend on keywords into these high-impact areas:
- Write a strong title tag. Make it descriptive, front-load your primary topic, and keep it within roughly 60 characters so it doesn’t truncate.
- Craft a compelling meta description. Treat it as ad copy — clear, specific, and click-worthy in around 150–160 characters.
- Improve on-page content. Genuine depth, clarity, and helpfulness are what modern search engines reward.
- Set up Open Graph tags. Clean previews on social platforms drive clicks and shares.
- Speed up your site. Faster load times improve both rankings and user experience.
Frequently asked questions
Does adding meta keywords hurt my SEO? It won’t directly penalize you, but it offers no ranking benefit and publicly exposes your keyword list to competitors. The opportunity cost — time spent on a useless tag — is the real downside.
Will Google ever use the meta keywords tag again? There’s no indication it will. Google explicitly dropped it as a ranking signal long ago due to widespread abuse, and modern ranking relies on content quality, links, and user signals instead.
Do I need a plugin to add a meta description in WordPress? No. As shown above, a short `wp_head` function in your child theme’s `functions.php` can output a dynamic meta description pulled from a custom field or post excerpt — no plugin required.
Why use a child theme instead of editing the parent theme directly? Editing the parent theme means your changes are wiped out the next time the theme updates. A child theme keeps your customizations safe and separate from the parent’s core files.
What’s the safest way to test functions.php changes? Use a staging site that mirrors your live environment. You can break things freely on staging, confirm everything works, then push the changes live with confidence.
Conclusion
The honest answer to “how to add meta keywords in WordPress without a plugin” is that you *can* — with a simple `wp_head` hook in your child theme’s `functions.php` — but for SEO you almost certainly *shouldn’t*. The tag is obsolete, ignored by Google, and quietly reveals your strategy to competitors. Reserve it for genuine legacy or system-specific needs. Then point your energy at the tags and signals that actually earn results: a sharp title tag, a persuasive meta description, clean Open Graph tags, strong content, and fast hosting.