Meta keywords go directly into your WordPress theme files, not through the dashboard

Meta keywords are HTML tags that sit in the invisible part of your website — the code that search engines read but visitors never see. WordPress does not have a built-in dashboard button to add them, which is why many people assume they need a plugin. You do not. You can add them by editing two files: your theme's header file and your functions file. Both edits take less than five minutes once you know where to look.

The reason WordPress leaves this out of the dashboard is that meta keywords matter far less than they once did. Google stopped using them as a ranking signal around 2009. That said, some search engines and accessibility tools still read them, and adding them costs you nothing. If you want them on your site, the direct approach — editing the code yourself — is faster than installing and configuring a plugin.

Key Takeaways

  • Meta keywords live in your theme's header.php file, not in the WordPress dashboard, and you add them by pasting a single line of code.
  • You can add the same keywords to every page using your theme's functions.php file, or add different keywords to individual posts using a custom field.
  • WordPress's built-in custom fields feature lets you set keywords per post without touching code after the initial setup.
  • Most modern search engines ignore meta keywords, but some accessibility tools and older search engines still read them.

Access your theme files through the WordPress editor

Log into your WordPress dashboard. On the left sidebar, click Appearance, then click Theme File Editor. You will see a list of your theme's files on the right side. Do not be alarmed by the code — you are only pasting one line into a specific spot.

If you do not see Theme File Editor, your hosting provider may have disabled it for security reasons. In that case, you will need to use an FTP client like FileZilla to access your files directly, or ask your hosting provider to enable the editor. Most hosts allow it by default.

Add keywords to every page at once using functions.php

Open the functions.php file from the list on the right. Scroll to the very bottom and paste this code:

add_action( 'wp_head', function() { echo '<meta name="keywords" content="your keywords here, separated by commas">'; } );

Replace "your keywords here, separated by commas" with the actual keywords you want. For example: "home repair, drywall installation, contractor services, residential construction". Save the file. The keywords now appear on every page of your site.

This method is the fastest if you want the same keywords on all pages. If you want different keywords for different posts or pages, use the custom field method instead.

Add different keywords to individual posts using custom fields

If you want to set keywords separately for each post or page, use WordPress's built-in custom fields. First, add this code to your functions.php file at the bottom:

add_action( 'wp_head', function() { if ( is_singular() ) { $keywords = get_post_meta( get_the_ID(), 'post_keywords', true ); if ( $keywords ) { echo '<meta name="keywords" content="' . esc_attr( $keywords ) . '">'; } } } );

Save the file. Now go to any post or page in your WordPress dashboard. Scroll down to the bottom and look for a box labeled Custom Fields. If you do not see it, click Screen Options at the top right and check the Custom Fields checkbox.

Click Add New in the Custom Fields box. In the Name field, type post_keywords. In the Value field, type your keywords for that post, separated by commas. Click Add Custom Field. Repeat this for each post where you want different keywords.

Add keywords directly to your header.php file

If you prefer to edit the header file instead of using functions.php, open header.php from the file list. Look for the line that says </head> — this is where the invisible part of your page ends. Just before that line, paste this code:

<meta name="keywords" content="your keywords here, separated by commas">

Replace the placeholder text with your actual keywords. Save the file. This method works the same way as the functions.php method, but it lives in a different location. Use whichever feels more natural to you — the result is identical.

Check that your keywords are actually there

Visit your website in a browser. Right-click anywhere on the page and select View Page Source (or Inspect in some browsers). Press Ctrl+F (or Cmd+F on Mac) and search for the word "keywords". You should see your meta keywords tag appear in the code. If it does not show up, double-check that you saved the file and that your code has no typos.

If you used the custom field method, make sure you typed post_keywords exactly — it is case-sensitive. If you used functions.php, make sure the closing semicolon and parenthesis are there.

Remove the code if you change your mind

If you decide you do not want meta keywords anymore, go back to the file where you added the code and delete the lines you pasted. Save the file. The keywords will disappear from your site within a few hours as search engines re-crawl your pages.

If you used the custom field method, you can leave the code in functions.php — it will straightforward do nothing if no custom fields are set. Or delete it if you prefer a cleaner file.

Frequently Asked Questions

Will adding meta keywords help my search rankings?

No. Google and most major search engines stopped using meta keywords as a ranking signal in 2009. They may help with some smaller search engines or accessibility tools, but they will not improve your position in Google results. Add them only if you want them for organizational purposes.

What if I break something while editing the files?

If you paste code incorrectly, your site might show a blank page or an error. To fix it, go back to the Theme File Editor, find the code you added, delete it, and save. Your site should return to normal within seconds. If it does not, contact your hosting provider — they can restore a backup.

Can I use both functions.php and custom fields at the same time?

Yes. If you set up both, pages with custom fields will use those keywords, and pages without custom fields will use the default keywords from functions.php. This lets you have site-wide defaults and override them on specific posts.

Do I need to add keywords to every page?

No. Keywords are optional. If you add them to functions.php, they appear everywhere automatically. If you use custom fields, you only add them to posts where you want them. Many modern websites skip meta keywords entirely.

What keywords should I use?

Use short phrases related to what the page is about — usually three to five words per phrase, separated by commas. For a page about home repair, you might use "home repair, drywall repair, wall damage, residential contractor". Keep them relevant to the actual content on the page.