Skip to content
ThemesCraft.

How to Add Keywords in WordPress (With and Without Plugins)

The seven places keywords actually belong in WordPress, why the meta keywords tag does nothing, and the functions.php method done properly with escaping.

Quick answer

You can add keywords in WordPress without plugins by placing them in the seven locations search engines actually read: the title tag, the URL slug, the H1, the first hundred words, the subheadings, image alt text, and internal link anchors. You can also add a meta keywords tag with a short snippet in functions.php, and it is worth knowing that Google has ignored that tag since 2009. Both methods are below. Only one of them affects rankings.

Search for how to add keywords in WordPress and nearly every result teaches the same thing: add a filter to functions.php, enable custom fields, create a field called keywords, type your keywords into it. It works. The tag appears in your source code. Nothing happens.

Google announced in 2009 that it does not use the meta keywords tag as a ranking signal, and that has not changed. Bing treats it at best as a spam indicator. The tutorials are technically accurate and answer a question that has been obsolete for over fifteen years.

The question underneath is a real one, though: where do keywords go in WordPress so that a page ranks for them? That has a specific, checkable answer. This guide covers both, starting with the version that works, because if you only read one section it should be that one. The functions.php method is here too, done properly, for the cases where you genuinely need it.

The seven places keywords actually belong

None of these require a plugin. All of them are editable from the standard WordPress editor.

LocationWhere in WordPressWeightThe mistake people make
Title tagPost title, or SEO plugin title fieldHighBurying the term at the end after brand name
URL slugPermalink, under the title in the editorModerateLeaving the auto-generated slug full of stop words
H1The post title, rendered by the themeHighAdding a second H1 in a page builder block
First 100 wordsOpening paragraphModerateThree sentences of preamble before the topic appears
H2 and H3 subheadingsHeading blocksModerateClever headings that name nothing searchable
Image alt textMedia library, or the block sidebarLow, plus accessibilityLeaving it blank, or stuffing every image with the same phrase
Internal link anchorsLinks from your other postsModerate and underratedLinking with click here instead of the topic
Weight is relative and directional rather than measured. The ordering reflects consistent practitioner consensus, not a published scoring model.

The last row is the one that gets ignored and the one you have most control over. Every internal link you write is a statement about what the destination page is about, in words you choose. Ten existing posts linking to a new page with descriptive anchor text is a stronger signal than any amount of on-page adjustment to the page itself.

Pro tip

Edit the slug before you publish, not after. WordPress generates it from your title, which means a title like The 10 Best Ways to Add Keywords in WordPress in 2026 becomes a slug full of numbers and stop words. Trim it to the core phrase. After publishing, changing it breaks the URL, and WordPress will not redirect the old one for you.

How to do it, step by step, with no plugins

  1. Pick one primary phrase per page. Not five. A page that targets five phrases usually ranks for none, because nothing on it is unambiguously about any of them.
  2. Put that phrase in the post title, as close to the front as reads naturally. WordPress uses the title as both the H1 and, absent a plugin, the title tag.
  3. Trim the slug to the phrase itself. Click Edit next to the permalink in the editor sidebar. Three to five words is plenty.
  4. Use the phrase in the first sentence or two, in a sentence that would exist anyway. If it reads like it was inserted, it was.
  5. Write subheadings that name things. Use the variations and questions people actually search, which are visible in the People Also Ask box and the related searches at the bottom of the results page.
  6. Write real alt text describing each image. The accessibility benefit is the point; the keyword benefit is incidental and small.
  7. Go back and link to the new page from three or four existing posts, using descriptive anchor text. This is the step everyone skips and it is the one with the most leverage.

That is the entire method. No plugin, no custom field, no meta tag.

What about WordPress tags?

A persistent misunderstanding deserves its own section. WordPress tags are not SEO keywords. They are a taxonomy for organising content, and each one generates an archive page listing the posts assigned to it.

Adding fifteen tags to a post does not tell Google what the post is about. It creates up to fifteen thin archive pages, each listing one post, competing with that post in the index. The recommendation is straightforward: use tags sparingly, only where a tag will eventually group a meaningful number of posts, and noindex tag archives unless a specific one earns traffic on its own.

The meta keywords method, done correctly

There are legitimate reasons to want this tag. Some internal site search tools read it, certain regional search engines historically used it, and some enterprise content audits require it. If one of those applies, here is the implementation. If none does, skip this section, because the tag will not help you.

The version circulating in most tutorials outputs the custom field value unescaped and unvalidated, which puts user-controlled data straight into your document head. This one escapes it.

// Add to a child theme functions.php or a small custom plugin.
// Never to a parent theme, which updates will overwrite.

function tc_output_meta_keywords() {
    if ( ! is_singular() ) {
        return;
    }

    $keywords = get_post_meta( get_the_ID(), 'keywords', true );

    if ( empty( $keywords ) ) {
        return;
    }

    printf(
        '<meta name="keywords" content="%s" />' . "\n",
        esc_attr( $keywords )
    );
}
add_action( 'wp_head', 'tc_output_meta_keywords' );

Three things this does that the common version does not: it bails out on anything that is not a single post or page, so archives do not inherit a stale value; it exits quietly when the field is empty rather than printing an empty tag; and it runs the value through esc_attr() before output.

Then enable custom fields in the editor. In the block editor, open the three-dot menu at the top right, choose Preferences, then Panels, and switch on Custom fields. The page reloads with a Custom Fields panel below the content. Add a field named keywords with a comma-separated value.

Watch out

Never paste this into your active parent theme’s functions.php. The next theme update overwrites the file and your code disappears without warning. Use a child theme, or better, a one-file custom plugin in wp-content/plugins, which survives theme changes entirely and can be deactivated from the dashboard if it ever causes a fatal error.

Where an SEO plugin genuinely helps

You do not need one to add keywords. There are three things a plugin does that you cannot do from the standard editor, and they are worth having.

  • A title tag separate from the H1. Without a plugin these are the same string. Being able to write a longer, clearer H1 and a tighter title tag that fits the search result is a real advantage.
  • Meta descriptions. Not a ranking factor, but it is the text under your link in the results. It determines whether the ranking you earned turns into a visit.
  • Automatic redirects on slug changes, which prevents the most common self-inflicted SEO injury in WordPress.

The focus keyword field and its traffic-light score are the features people fixate on and the least important. It checks whether your phrase appears in a list of locations. It cannot assess whether the page answers the question, which is the part that decides the outcome.

Keyword stuffing, and the line

Nobody publishes a target keyword density any more because there is not one. The practical test is simpler than any number: read the page aloud. If a phrase appears in a way a person would not say it, or the same phrase lands three times in a paragraph, that is stuffing, and it is an explicit spam policy violation rather than merely bad writing.

Variations are better than repetition. A page about adding keywords in WordPress should also contain words like meta description, slug, permalink, alt text and title tag, because those are the terms a page genuinely about the topic would contain. Covering the subject properly produces the right vocabulary as a side effect, which is the whole reason topical coverage outperforms phrase repetition.

A checklist before you publish

  • One primary phrase chosen, and it appears in the title.
  • Slug trimmed to that phrase, edited before publishing.
  • Phrase appears naturally in the first two sentences.
  • Exactly one H1. Subheadings are H2, with H3 nested under them.
  • Every image has alt text that describes the image.
  • At least three internal links in, from existing posts, with descriptive anchors.
  • Tags used sparingly or not at all.
  • Read aloud once. Nothing sounds inserted.

The broader technical picture, including which of these WordPress already handles for you, is in our guide to whether WordPress is good for SEO, and if you decide the plugin route is worth it, essential WordPress plugins compares the options without the affiliate framing.

Frequently asked questions

How do I add keywords in WordPress without a plugin?

Place your target phrase in the post title, the URL slug, the first hundred words, at least one subheading, relevant image alt text, and the anchor text of internal links pointing at the page. All six are editable from the standard WordPress editor with nothing installed. That is the method that affects rankings, and it does not involve a meta keywords tag.

Does the meta keywords tag still work in 2026?

Not for Google, which announced in 2009 that it does not use the tag as a ranking signal, and that has not changed since. Bing treats it at most as a spam indicator. Some internal site search tools and certain regional engines still read it, so there are narrow legitimate uses, but adding it will not improve your position in Google.

Are WordPress tags the same as SEO keywords?

No, and treating them that way causes harm. Tags are a content taxonomy, and each one generates an archive page. Adding fifteen tags to a post creates up to fifteen thin archive pages listing a single post each, competing with that post in the index. Use tags only where they will eventually group a meaningful number of posts, and noindex tag archives.

How many keywords should one WordPress post target?

One primary phrase, plus the natural variations that appear when you cover the topic properly. A page built around five different target phrases usually ranks for none, because nothing about it is unambiguously about any single one. If you have five phrases worth targeting, that is often five pages rather than one.

Where do I add a meta description in WordPress?

WordPress core has no field for it. You need an SEO plugin such as Rank Math, Yoast or SEO Framework, which add a description field below the editor. Without one, search engines generate a snippet from your page text. The description is not a ranking factor, but it is the text under your result and it determines click-through.

Is it safe to add code to functions.php?

Only in a child theme or a custom plugin. Code added to an active parent theme is deleted the next time that theme updates, with no warning. A one-file plugin in wp-content/plugins is safer still, because it survives theme changes and can be deactivated from the dashboard if it ever causes a fatal error that locks you out.

What is the ideal keyword density for a WordPress post?

There is no target figure, and chasing one produces worse writing. The practical test is to read the page aloud. If a phrase appears in a way nobody would say it, or lands three times in one paragraph, it is stuffing, which is an explicit spam policy violation. Covering the subject properly generates the right vocabulary without counting anything.

Should I change an old post slug to add my keyword?

Rarely worth it. Changing a published slug changes the URL, WordPress does not create a redirect, and any links and ranking history attached to the old address are lost. The gain from a better slug is small; the loss from an unredirected 404 can be large. If you do change it, add a 301 from the old path in the same sitting.

Leave a response

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