SEO & Analytics

How to Add Meta Keywords in WordPress

A practical guide to using legacy meta keywords with plugins and code (without hurting your SEO)

Meta keywords are one of those SEO settings that refuse to die. Even though major search engines ignore the <meta name="keywords"> tag, clients, stakeholders, and legacy tools still sometimes ask you to “add meta keywords in WordPress.”

In this guide, you’ll learn how to add meta keywords in WordPress using two approaches: via any SEO plugin that still supports them and with a lightweight code snippet that works without a plugin. You’ll also see best practices so you don’t accidentally hurt your SEO or performance.

If you’re new to on-page optimization, it’s smart to pair this with a broader step-by-step guide to on-page SEO in WordPress, because meta keywords are just a tiny (and optional) part of the picture.

Prerequisites

Before you start adding meta keywords, make sure you have the right access and safety steps in place. You’ll be working inside the WordPress admin and possibly touching theme code.

  • A working WordPress site where you can log in as an Administrator.
  • Access to the post or page editor (Classic Editor or Block Editor).
  • Optional: An SEO plugin installed and configured if you want the plugin-based method.
  • Optional but strongly recommended: A recent full backup of your site (files and database).
Warning: If you plan to edit theme files, always use a child theme or a code snippets plugin and have a backup ready. Editing a live theme’s functions.php directly can break your site if there’s a typo.

Step 1: Understand What Meta Keywords Really Do

Meta keywords are an HTML tag that looks like this inside your page’s <head> section: they simply list words or phrases you think are relevant to the page. For example, a blog post about WordPress SEO might include “wordpress seo, meta keywords, on-page optimization.”

However, major search engines (including Google) have publicly stated they do not use the meta keywords tag for rankings. That means adding meta keywords in WordPress will not suddenly boost your organic visibility. It’s mainly useful today for legacy internal search tools, minor search engines, or when a client explicitly requires it.

<meta name="keywords" content="wordpress meta keywords, add meta keywords in wordpress, legacy seo settings">
Warning: Never rely on meta keywords as your primary SEO strategy. Focus on high-quality content, meaningful title tags, and meta descriptions first.

Step 2: Add Meta Keywords with an SEO Plugin (When Supported)

Many modern SEO plugins (including popular options like Yoast SEO and Rank Math) no longer support meta keywords at all. That’s intentional, because the tag is obsolete for rankings. Still, some plugins and themes expose a “Meta Keywords” or “Keywords” field that outputs a meta keywords tag for you.

If your plugin offers a meta keywords option, follow these steps to use it safely:

  1. Log in to your WordPress dashboard and open the post or page where you want to add meta keywords.
  2. Scroll down to the SEO plugin panel below the content editor. Look for a tab or section labeled “Advanced,” “Additional,” or “Other meta tags.”
  3. Find the field named “Meta Keywords,” “Keywords,” or similar. Enter 3–8 focused phrases that actually appear in your content, separated by commas.
  4. Click Update or Publish to save your changes.
WordPress editor displaying Yoast SEO plugin settings with the focus keyphrase 'how to add keywords in WordPress' and a mobile search snippet preview.
This screenshot shows the Yoast SEO meta box in the WordPress editor, highlighting the ‘Focus keyphrase’ field and a preview of the mobile search result.
Pro Tip: Treat meta keywords as a summary, not a dumping ground. Use short phrases, avoid duplicates, and skip irrelevant terms that don’t appear on the page.

Step 3: Add Meta Keywords Manually Without a Plugin

If your SEO plugin doesn’t support meta keywords—or you prefer full control—you can output the meta keywords tag with a small code snippet. This approach works well if you’re comfortable with basic PHP and understand how to use a child theme or a code snippets plugin.

At a high level, you’ll store meta keywords in a custom field on each post and then print that value inside the <head> section using the wp_head hook.

  1. In your WordPress admin, install and activate a safe “Code Snippets” style plugin, or ensure you have a child theme ready. You’ll add your code there, not in the main theme.
  2. Add the following snippet to your child theme’s functions.php file or via your code snippets plugin (run it on the front end):
    function whp_meta_keywords_tag() {
        if ( ! is_singular() ) {
            return;
        }
    
        $keywords = get_post_meta( get_the_ID(), 'meta_keywords', true );
    
        if ( empty( $keywords ) ) {
            return;
        }
    
        echo '<meta name="keywords" content="' . esc_attr( $keywords ) . "\" />\n";
    }
    add_action( 'wp_head', 'whp_meta_keywords_tag' );

    This code checks if you’re on a single post or page, retrieves a custom field called meta_keywords, and outputs a meta keywords tag if the field isn’t empty.

  3. Edit any post or page where you want meta keywords, and add a custom field:
    • In the Classic Editor, enable “Custom Fields” in the screen options if needed, then create a field named meta_keywords.
    • In the Block Editor, use a custom fields plugin or a custom meta box that maps to the same meta_keywords key.

    Put your comma-separated keyword phrases in the field value and click Update.

  4. View the page source for that post to confirm the <meta name="keywords"> tag is present inside the <head> section.
Note: Always use escaping functions like esc_attr() when outputting user-entered data inside HTML attributes. This protects against malformed HTML and basic injection issues.

If you want a deeper, code-first walkthrough focused entirely on the snippet method, see our dedicated guide on how to add meta keywords in WordPress without a plugin.

Step 4: Check That Meta Keywords Are Output Correctly

Once you’ve configured meta keywords via a plugin or code, verify that the tag is actually output in the page’s HTML. A simple view-source check is usually enough.

  1. Open the page in your browser and make sure any caching or security plugins have finished deploying changes.
  2. Right-click the page and choose View Page Source (or use your browser’s equivalent menu option).
  3. Press Ctrl + F (or Cmd + F on Mac) and search for meta name="keywords".
  4. Confirm that the tag appears once in the <head> section and that its content attribute matches the keywords you entered.
Note: If you use a caching plugin or a CDN, you may need to clear cache before you’ll see the updated meta keywords tag in the page source.

Step 5: Use Meta Keywords Without Hurting Your SEO

Even though meta keywords no longer drive rankings, poor implementation can still signal low-quality SEO (for example, obvious keyword stuffing). Treat them as a tidy, optional signal, not a shortcut.

  • Keep it short: 3–8 keyword phrases are usually enough for a single page.
  • Use phrases that already appear in your headings or body content; don’t add unrelated terms just to “cover more keywords.”
  • Avoid repeating the same phrase multiple times—search engines can see that as spammy, even if they ignore the tag itself.
  • Skip competitor brand names and misleading phrases; they can hurt trust and don’t help rankings.
  • Make sure your more important meta tags (title and description) are properly set up—see our guide on how to add meta tags in WordPress for a complete overview.
Pro Tip: If you’re pressed for time, prioritize optimizing your title tag, meta description, and on-page content. Meta keywords should never be the task that delays publishing a good post.

Bring Meta Keywords Back Under Control

Adding meta keywords in WordPress is no longer an SEO game changer, but it can still be useful when you need to support legacy tools or satisfy specific client requirements. With the plugin-based and manual methods above, you can add the tag cleanly without bloating your site or introducing errors.

Most importantly, you now know how to keep meta keywords in their proper place: as an optional, low-priority setting behind real on-page SEO work. Combine this guide with your broader content and optimization strategy, and you’ll keep both search engines and stakeholders happy.

Further Reading

Frequently Asked Questions

Do meta keywords still help SEO in WordPress?

No—major search engines such as Google do not use the meta keywords tag as a ranking factor anymore. Adding meta keywords won’t directly boost your rankings, but it can still be helpful for legacy systems or internal search tools that read the tag.You should treat meta keywords as an optional extra, not a core optimization. Focus on solid content, smart internal linking, and strong title and description tags first.

Why can’t I find a Meta Keywords field in my SEO plugin?

Many popular SEO plugins removed meta keywords support on purpose because the tag has been retired as a ranking signal. If you don’t see a Meta Keywords field in your plugin settings or post editor box, it usually means the plugin no longer outputs that tag.In that case, you can either switch to a plugin that still supports meta keywords or use the manual code snippet method described in this guide to output the tag yourself.

My meta keywords tag isn’t showing in the page source. What went wrong?

If you followed the steps but don’t see <meta name="keywords"> in the page source, first clear any page caching and CDN caches, then reload the page. Cached HTML often hides recent changes.For the manual method, double-check your code snippet for syntax errors, confirm it’s active, and make sure the meta_keywords custom field is filled in for that specific post. For plugin-based methods, verify the feature is enabled and that you’ve saved the post after adding keywords.

Can meta keywords create security or privacy problems?

Meta keywords themselves aren’t a security vulnerability, but they do expose the phrases you’re targeting to anyone who views your source code. Some site owners prefer not to reveal this level of detail to competitors.If you output meta keywords dynamically from custom fields, always sanitize the value with functions like esc_attr() to avoid malformed HTML and basic injection issues in the <head> section.

Is it worth the time to add meta keywords to every WordPress post?

Usually, no. Because meta keywords are no longer a ranking factor, manually adding them to hundreds of posts rarely produces a measurable SEO benefit. The return on your time investment is low compared to improving content, internal linking, or page speed.Reserve meta keywords for special cases—like pages that must integrate with an internal search tool that reads the tag—or add them only to your most important landing pages if a client requires it.

Related Articles

Leave a Reply

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

Back to top button