4 min read
How to Add Meta Keywords in WordPress Without a Plugin
Before adding a meta keywords tag to your site, it’s worth knowing what it actually does in 2026: nothing, as far as Google is concerned. Google confirmed back in 2009 that the meta keywords tag has zero effect on rankings, and that hasn’t changed. If your only goal is better Google rankings, this isn’t the tag that gets you there.
That said, there are real reasons people still add it, a client contract that specifies it, a legacy content migration that expects the field, an internal search tool or third-party directory that reads it, or Bing, which has said it may use the tag as a minor signal (including as a spam flag if abused). If one of those applies to you, here’s how to add it without installing a plugin.
Do meta keywords still matter for SEO?
Not for Google. Not for ranking, not for indexing, not for anything measurable. Stuffing the tag with keywords doesn’t help and, on some search engines, can actually count against you as a spam signal. If you’re here because you read that meta keywords “still help a little,” that claim doesn’t hold up for the search engine that matters to most sites.
What actually moves rankings: the page title, the meta description (for click-through rate, not ranking directly), heading structure, content quality, and internal linking. Our WordPress SEO guide covers those in more depth.
Method 1: A single sitewide meta keywords tag
If you just want one static keywords tag across the whole site, add this to your theme’s functions.php (in a child theme, so it survives a parent theme update):
function wbcom_sitewide_meta_keywords() {
echo '<meta name="keywords" content="' . esc_attr( 'your, comma, separated, keywords' ) . '">' . "\n";
}
add_action( 'wp_head', 'wbcom_sitewide_meta_keywords' );
This is the fastest option, but it puts the same keywords on every page, which defeats the point of the tag even where it’s still read.
Method 2: Per-post meta keywords with a custom field
A more useful approach lets you set different keywords per post from the editor, using a meta box and a custom field. This is the same mechanism SEO plugins use internally, just without the plugin.
Add the meta box:
function wbcom_register_keywords_metabox() {
add_meta_box(
'wbcom_meta_keywords',
'Meta Keywords',
'wbcom_render_keywords_metabox',
array( 'post', 'page' ),
'side'
);
}
add_action( 'add_meta_boxes', 'wbcom_register_keywords_metabox' );
function wbcom_render_keywords_metabox( $post ) {
wp_nonce_field( 'wbcom_save_keywords', 'wbcom_keywords_nonce' );
$value = get_post_meta( $post->ID, '_wbcom_meta_keywords', true );
echo '<input type="text" name="wbcom_meta_keywords" value="' . esc_attr( $value ) . '" style="width:100%;" placeholder="keyword one, keyword two" />';
}
function wbcom_save_keywords_metabox( $post_id ) {
if ( ! isset( $_POST['wbcom_keywords_nonce'] ) || ! wp_verify_nonce( $_POST['wbcom_keywords_nonce'], 'wbcom_save_keywords' ) ) {
return;
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
return;
}
if ( isset( $_POST['wbcom_meta_keywords'] ) ) {
update_post_meta( $post_id, '_wbcom_meta_keywords', sanitize_text_field( $_POST['wbcom_meta_keywords'] ) );
}
}
add_action( 'save_post', 'wbcom_save_keywords_metabox' );
Then output it on singular posts and pages:
function wbcom_output_meta_keywords() {
if ( is_singular() ) {
$keywords = get_post_meta( get_the_ID(), '_wbcom_meta_keywords', true );
if ( $keywords ) {
echo '<meta name="keywords" content="' . esc_attr( $keywords ) . '">' . "\n";
}
}
}
add_action( 'wp_head', 'wbcom_output_meta_keywords' );
The nonce check and capability check in the save function aren’t optional extras, without them, the field is a straightforward attack surface for anyone who can submit a request to your admin.
Method 3: Directly in header.php
Editing header.php directly and hardcoding a <meta name="keywords"> tag inside <head> works, but only in a child theme. Edit the parent theme’s file directly and the next theme update wipes it out. This method also doesn’t scale past a single static tag, so Method 2 is worth the extra ten minutes for anything beyond a single-page site.
Where to put your effort instead
If the goal is actually ranking better, meta keywords aren’t the lever. A properly written title tag, a meta description that earns the click, clean heading structure, and internal links to related content do the work that meta keywords no longer do. Our comparison of WordPress SEO plugins covers the tools that actually influence what shows up in search results.
Frequently asked questions
Does adding meta keywords hurt my SEO?
Adding a reasonable, honest tag doesn’t hurt on Google, since it’s ignored entirely. Keyword-stuffing the tag can be flagged as a spam signal on search engines that do read it, so if you add it, keep it accurate and short.
Do any search engines still use the meta keywords tag?
Bing has stated it may factor the tag in as a minor signal, mostly to detect spam rather than to boost rankings. No major search engine treats it as a ranking factor in 2026.
Should I remove meta keywords if my site already has them?
Removing them won’t change your Google rankings either way. Leave them if a plugin or process already manages them; there’s no urgency to strip them out.
Is this different from adding a focus keyword in Yoast or Rank Math?
Yes, unrelated. A “focus keyword” in an SEO plugin is an internal content-optimization guide for you, the author, it doesn’t generate a public meta keywords tag and isn’t seen by search engines as such.
Related reading