# How to Add Meta Keywords in WordPress Without a Plugin Meta keywords have a complicated history in SEO, and WordPress doesn't include a built-in field for them by default. If you want to add them manually — without installing a plugin — it's entirely possible, but the method requires editing your theme files directly. Before diving into the how, it's worth understanding what meta keywords actually do (and don't do) in 2024. ## What Are Meta Keywords, and Do They Still Matter? **Meta keywords** are HTML tags placed in the `` section of a webpage that list relevant search terms associated with that page's content. They look like this: ```html ``` Here's the honest reality: **Google officially ignores meta keywords** and has done so since 2009. Bing has also stated it treats them as a spam signal in some contexts. Most major search engines consider them obsolete for ranking purposes. That said, there are legitimate reasons you might still want to add them: - Internal site search tools sometimes read meta keywords - Some CMS platforms and aggregators still use them - Certain legacy systems or internal documentation workflows reference them - You're working on an intranet or controlled environment where custom parsers use the field If your goal is purely Google SEO, meta keywords will not move the needle. But if you have a technical or platform-specific reason to include them, here's how to do it without a plugin. ## Method 1: Edit Your Theme's `header.php` Directly The most straightforward approach is adding the meta tag globally to your theme's header file. **Steps:** 1. Go to **Appearance → Theme File Editor** in your WordPress dashboard (or access the file via FTP/SFTP) 2. Locate `header.php` in your active theme's file list 3. Find the `` section — look for the ` ` or ` ` lines 4. Add your meta keywords tag **before** the closing `` tag: ```html ``` **Important caveat:** This adds the same keywords to *every page on your site*, which is almost never what you want for SEO or content organization purposes. It also gets overwritten whenever you update your theme, unless you're using a **child theme**. ✅ **Best practice:** Always make edits like this in a child theme, not the parent theme directly. ## Method 2: Use `functions.php` to Add Keywords Per Post For page-level control without a plugin, you can use WordPress's `wp_head` hook inside your theme's `functions.php` file. This approach lets you pull keywords from a **custom field** you define per post or page. **Step 1 — Add the function to `functions.php`:** ```php function custom_meta_keywords() { if ( is_singular() ) { global $post; $keywords = get_post_meta( $post->ID, 'meta_keywords', true ); if ( $keywords ) { echo ' '; } } } add_action( 'wp_head', 'custom_meta_keywords' ); ``` **Step 2 — Add a custom field to your posts:** In the WordPress post editor, scroll down to **Custom Fields** (you may need to enable it under Screen Options). Add a new custom field with: - **Name:** `meta_keywords` - **Value:** `your, comma, separated, keywords` This method gives you per-page control, which is significantly more useful than a global tag. ## Method 3: Hardcode Keywords into a Page Template If you need keywords on a specific page type only — say, your homepage or a landing page — you can edit that specific **page template file** (e.g., `front-page.php` or `page.php`) and add the tag directly within a conditional check: ```php ``` This is more surgical than editing `header.php` globally but still requires theme file access and carries the same child theme caveat. ## Key Variables That Affect Which Method Makes Sense 🔧 | Factor | Impact | |---|---| | **Theme type** | Child theme vs. parent theme changes where edits should live | | **Technical comfort** | Direct PHP edits carry risk if you're unfamiliar with WordPress file structure | | **Scope needed** | Global vs. per-page keywords require different methods | | **Update frequency** | Frequent theme updates may overwrite non-child theme edits | | **Block vs. Classic editor** | Custom fields behave slightly differently in the block editor (Gutenberg) | ## What Can Go Wrong Editing `functions.php` or `header.php` without care can break your site if there's a PHP syntax error. Always: - **Back up your site** before editing theme files - Use a **staging environment** if available - Test on a single post/page before rolling out broadly The block editor (Gutenberg) hides custom fields by default — you'll need to enable them via the editor's **Options menu** (three-dot icon in the top right) → **Preferences → Panels → Custom Fields**. ## How Technical Skill Level Changes the Equation Someone comfortable with PHP, WordPress hooks, and child themes can implement the `functions.php` method cleanly and maintain it over time. Someone newer to WordPress file editing may find even a small syntax error frustrating to troubleshoot, especially without staging access. The global `header.php` edit is simpler to execute but coarser in what it produces. The custom fields method offers more precision but adds a manual workflow step every time you publish content. Your specific WordPress setup — theme framework, hosting environment, whether you're using a page builder, and how frequently content changes — determines which of these methods is practical to maintain long term rather than just functional on day one. 🧩