{"id":102002,"date":"2022-04-13T09:24:00","date_gmt":"2022-04-13T14:24:00","guid":{"rendered":"https:\/\/wpengine.com\/?post_type=resource&#038;p=102002"},"modified":"2024-09-28T11:06:26","modified_gmt":"2024-09-28T16:06:26","slug":"how-to-add-meta-tags-wordpress","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/","title":{"rendered":"How to Add Meta Tags in WordPress"},"content":{"rendered":"\n<p>When search engines index your website, you will want them to understand what it\u2019s all about. That way, they can do a better job of showing your pages to interested browsers.<\/p>\n\n\n\n<p>Fortunately, you can affect what information is shown in search results by adding meta tags to your website. This enables you to show off your content to browsers, and encourages them to click through. Plus, it doesn\u2019t have to be a complicated process.<\/p>\n\n\n\n<p>In this article, we\u2019ll cover what meta tags are and why they are important. We\u2019ll then look at how to add them to your website, both with and without a plugin. Let\u2019s get to work!<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">What Are Meta Tags?<\/h2>\n\n\n\n<p>A meta tag is a snippet of HTML code that describes the content of a website or a specific web page. These bits of data tell search engines what the page is about, and provide the content that will be displayed in search engine results.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Are Meta Tags Important?<\/h2>\n\n\n\n<p>Meta tags are not as important as they used to be, because search engines no longer use them to determine rankings. However, this does not mean you should ignore them. After all, meta tags still provide the description shown in search engine results, which can greatly increase your Click-Through Rates (CTRs).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method 1: Using the <a href=\"https:\/\/wordpress.org\/plugins\/wordpress-seo\/\" target=\"_blank\" rel=\"noreferrer noopener\">Yoast SEO<\/a> Plugin<\/h2>\n\n\n\n<p>The <a href=\"https:\/\/wordpress.org\/plugins\/wordpress-seo\/\" target=\"_blank\" rel=\"noreferrer noopener\">Yoast SEO<\/a> plugin offers built-in support for <a href=\"https:\/\/yoast.com\/wordpress\/plugins\/seo\/titles-and-meta-descriptions\/\" target=\"_blank\" rel=\"noreferrer noopener\">description and keyword meta tags<\/a>:<\/p>\n\n\n\n<p>This WordPress SEO plugin has made it one of the most common methods for adding meta tags to WordPress. Let&#8217;s take a look at how that process works.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install the Yoast SEO Plugin<\/h3>\n\n\n\n<p>To start adding meta tags to your content, you\u2019ll first need to download the Yoast SEO plugin. You can find it by searching for \u201cYoast SEO\u201d in your dashboard under the <em>Plugins<\/em> page.<\/p>\n\n\n\n<p>The plugin will need to be activated after it has been installed. There\u2019s both a free and <a href=\"https:\/\/yoast.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">a premium version<\/a>, but the free version will be sufficient for adding meta tags.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Add Meta Data to Your Posts and Pages<\/h3>\n\n\n\n<p>Once the plugin has been activated, navigate to <em>Pages<\/em> &gt; <em>All<\/em> or <em>Posts<\/em> &gt; <em>All<\/em>, depending on the type of content you want to add meta tags to. Click on <em>Edit<\/em>, and then scroll to the bottom of the screen where the Yoast SEO section is located:<\/p>\n\n\n\n<p>Enter your primary keyword into the <em>Focus Keyphrase<\/em> section. Then, click on the <em>Edit Snippet<\/em> button to enter <a href=\"https:\/\/yoast.com\/meta-descriptions\/\" target=\"_blank\" rel=\"noreferrer noopener\">your meta description<\/a>. This will be displayed in search engines, and should be a short paragraph describing the page\u2019s content and encouraging browsers to click through.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Save or Publish the Post or Page<\/h3>\n\n\n\n<p>Before moving on, it\u2019s a good idea to read over your meta tags and description. Do they summarize the content of the page accurately, and are they unique and compelling?<\/p>\n\n\n\n<p>Once you are happy with your meta tags, save the post or page, or publish it if you haven\u2019t already. That\u2019s all you have to do!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method 2: Add Meta Tag Without a Plugin<\/h2>\n\n\n\n<p>While Yoast SEO is the most common and simplest way to add meta tags to WordPress, you can also add the meta data in WordPress manually. Manually adding the necessary HTML tags to your <em>header.php<\/em> file is simple, but the tags will not be retained if you change your website\u2019s theme. These meta tags will also apply to the entire website, and will not be unique to each post or page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Open the header.php File<\/h3>\n\n\n\n<p>To add meta tags in WordPress without a plugin, you\u2019ll need to open the <em>header.php<\/em> file. This can be opened using File Manager or a <a href=\"https:\/\/wpengine.com\/support\/sftp\/\" target=\"_blank\" rel=\"noreferrer noopener\">Secure File Transfer Protocol (SFTP)<\/a> client:<\/p>\n\n\n\n<p>Once the file is open, you\u2019ll need to look for the <em>&lt;head&gt;<\/em> tag. Your meta data should be placed within those tags.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Copy and Customize the Meta Tags<\/h3>\n\n\n\n<p>Next, copy the generic <a href=\"https:\/\/codex.wordpress.org\/Meta_Tags_in_WordPress#Meta_Tag_Resources\" target=\"_blank\" rel=\"noreferrer noopener\">keyword meta tag<\/a> below and paste it under the opening <em>&lt;head&gt;<\/em> tag:<\/p>\n\n\n\n<p><code>&lt;meta name=\"keywords\" content=\"keywords related to the content of the website\" \/&gt;<\/code><\/p>\n\n\n\n<p>Then copy the generic description meta tag below, and paste it under the previous line:<\/p>\n\n\n\n<p><code>&lt;meta name=\"description\" content=\"meta description for the content of the website\" \/&gt;<\/code><\/p>\n\n\n\n<p>After that, you can replace the placeholders and fill in your own keywords and meta description. Both should be optimized for the content of your website as a whole.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3 (Optional): Use a Conditional Tag Query<\/h3>\n\n\n\n<p>How about the meta tags for a single WordPress post? If you want a different description tag for single-post views and multiple-post views, you can do that too. First, navigate to <em>Admin<\/em> &gt; <em>Options<\/em> &gt; <em>General<\/em>, and enter your meta description tag into the <em>Tagline<\/em> section.<\/p>\n\n\n\n<p>Then, the conditional tag query below can be added to your <em>header.php<\/em> file:&nbsp;<\/p>\n\n\n\n<p><code>&lt;meta name=\"description\" content=\"&lt;?php if ( is_single() ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;single_post_title('', true);&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;} else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bloginfo('name'); echo \" - \"; bloginfo('description');<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;?&gt;\" \/&gt;<\/code><\/p>\n\n\n\n<p>The conditional tag query will show the post\u2019s title in a single-post view. Alternately, the blog name and WordPress meta description will be shown in multiple-post views.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary: Key Details<\/h2>\n\n\n\n<p>Learning how to add meta tags in WordPress is fairly simple. You can use the Yoast SEO plugin to dynamically insert meta tags for each post and page on your website. You can also manually add meta tags to the <em>header.php<\/em> file. For dynamic meta description tags, you can use a conditional tag query.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Keep Learning with WP Engine<\/h2>\n\n\n\n<p>Learning how to add and use the right meta tags can make a big difference to your website\u2019s SEO. Optimized description tags can make your content more appealing in search engines, and should be retained when <a href=\"https:\/\/wpengine.com\/support\/sync-new-post-and-pages\/\" target=\"_blank\" rel=\"noreferrer noopener\">migrating posts and pages<\/a>. But you should also understand how important meta tags and meta keywords play in search engine optimization. If you want your site to rank high in search engines, use meta keywords appropriately throughout the content.<\/p>\n\n\n\n<p>As a developer, you need to know how to do things like use meta tags and <a href=\"https:\/\/wpengine.com\/support\/copy-site\/\" target=\"_blank\" rel=\"noreferrer noopener\">copy a development environment<\/a>. But there&#8217;s still a lot more to learn when it comes to WordPress that a single WordPress tutorial wouldn&#8217;t be enough. Other aspects worth learning include <a href=\"https:\/\/wpengine.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">hosting for WordPress sites<\/a>, exploring the WordPress dashboard, even formatting a WordPress post. WP Engine offers the best resources to help you learn everything you need, and <a href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\">build a smooth digital experience<\/a> for your customers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When search engines index your website, you will want them to understand what it\u2019s all about. That way, they can do a better job of showing your pages to interested browsers. Fortunately, you can affect what information is shown in search results by adding meta tags to your website. This enables you to show off<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":1,"featured_media":145878,"template":"","resource-topic":[910],"resource-role":[896,903,1296],"resource-type":[916],"class_list":["post-102002","resource","type-resource","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Add Meta Tags in WordPress<\/title>\n<meta name=\"description\" content=\"Meta tags are essential to increase your site\u2019s SEO performance. Learn how to add and edit meta tags on your WordPress site.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Add Meta Tags in WordPress\" \/>\n<meta property=\"og:description\" content=\"Meta tags are essential to increase your site\u2019s SEO performance. Learn how to add and edit meta tags on your WordPress site.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-28T16:06:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2022\/04\/meta-tags_1200x627.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"627\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2022\/04\/meta-tags_1200x627.png\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/\",\"name\":\"How to Add Meta Tags in WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2022-04-13T14:24:00+00:00\",\"dateModified\":\"2024-09-28T16:06:26+00:00\",\"description\":\"Meta tags are essential to increase your site\u2019s SEO performance. Learn how to add and edit meta tags on your WordPress site.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Add Meta Tags in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085\",\"name\":\"WP Engine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"caption\":\"WP Engine\"},\"sameAs\":[\"https:\/\/wpengine.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Add Meta Tags in WordPress","description":"Meta tags are essential to increase your site\u2019s SEO performance. Learn how to add and edit meta tags on your WordPress site.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"How to Add Meta Tags in WordPress","og_description":"Meta tags are essential to increase your site\u2019s SEO performance. Learn how to add and edit meta tags on your WordPress site.","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2024-09-28T16:06:26+00:00","og_image":[{"width":1200,"height":627,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2022\/04\/meta-tags_1200x627.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2022\/04\/meta-tags_1200x627.png","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/","name":"How to Add Meta Tags in WordPress","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2022-04-13T14:24:00+00:00","dateModified":"2024-09-28T16:06:26+00:00","description":"Meta tags are essential to increase your site\u2019s SEO performance. Learn how to add and edit meta tags on your WordPress site.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-add-meta-tags-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"How to Add Meta Tags in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085","name":"WP Engine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","caption":"WP Engine"},"sameAs":["https:\/\/wpengine.com"]}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2022\/04\/meta-tags_343x245.png","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":"<strong>Roles:<\/strong> Developer, Marketer, Publisher","topic":"<strong>Topics:<\/strong> SEO","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/102002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/1"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/145878"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=102002"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=102002"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=102002"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=102002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}