Estimated Reading Time: 2 min
Meta keywords and meta tags like copyright and author help improve the SEO and metadata structure of your website. While WordPress doesn’t provide built-in support for meta keywords, you can add them manually to your site’s header using the functions php file. Here’s a quick guide to implement it.
Why Add Meta Keywords?
Meta keywords are beneficial for organizing content and signaling important information to search engines. Although modern SEO focuses more on content quality and structure, meta keywords still have value in some contexts.
Adding Meta Keywords to WordPress
Access the functions.php
File
Log in to your WordPress admin dashboard, go to Appearance > Theme Editor
, and open your theme’s functions.php
file.
Insert the Code
Add the following code to include meta keywords for single posts and the homepage:
/* ------------------------------------------------------------------------- *
* Add Keywords and Meta Descriptions in WordPress.
/* ------------------------------------------------------------------------- */
function add_meta_keywords() {
if (is_single()) {
echo '<meta name="keywords" content="keyword1, keyword2, keyword3">';
echo '<meta name="author" content="Author Name">';
echo '<meta name="copyright" content="Your Website Name">';
} elseif (is_home() || is_front_page()) {
echo '<meta name="keywords" content="homepage keyword1, homepage keyword2">';
echo '<meta name="author" content="Site Admin">';
echo '<meta name="copyright" content="Your Website Name">';
}
}
add_action('wp_head', 'add_meta_keywords');
/* ------------------------------------------------------------------------- *
* End Keywords and Meta Descriptions in WordPress.
/* ------------------------------------------------------------------------- */

Save and Test
Save your changes and visit your site to check the page source. You should see the meta keywords, author, and copyright tags in the <head>
section.
Tips:
- Replace placeholder content with your actual keywords and details.
- Use relevant keywords to avoid SEO penalties.
By following this guide, you can easily enhance your site’s metadata and SEO.