How to Add Meta Tags in WordPress: 3 Simple Methods to Try

how to add meta tags in wordpress

Meta tags play a vital role in optimizing your website for search engines, making them a crucial part of your SEO strategy. These small pieces of HTML code provide search engines with key information about your content, helping your site rank higher in search results. This is why SEO experts always recommend adding meta tags to enhance the visibility and relevance of your pages.

If you’re using WordPress, adding meta tags is simple, and you can either use a plugin or do it manually. In this guide, we’ll show you both methods so you can choose the one that suits your needs.

What are Meta Tags?

Meta tags are snippets of text that give search engines a quick overview of your page content, helping boost your site’s visibility in search results.

In WordPress, meta tags like Title, Description, and Keywords don’t appear on the page itself but work behind the scenes. Here’s an example of a meta description tag:

<meta name="title" content="Hire WordPress Developers In 48 Hours">
<meta name="description" content="Hire WordPress developers from WPWeb Infotech and get hassle-free website development with the latest and advanced technology adoption & complete peace of mind.">

Here’s how it looks on search engines:

Meta tags on search engine

Why Do Meta Tags Matter for SEO?

Meta tags help search engines understand your content, which can improve your rankings. They also make your site more clickable by giving users a preview of your page. A good meta description can:

  • Increase clicks with a catchy summary
  • Target relevant keywords for better visibility
  • Align your content with what users are searching for

In WordPress, adding meta tags is easy, whether through plugins or manual tweaks. Let’s explore the best ways to get started!

Want to ensure the best SEO optimization practices for your website?

How to Add Meta Tags in WordPress?

WordPress is known for its flexibility, and it shows when you’re trying to add a meta description or tag. The platform offers multiple methods and tools to cater to users with different levels of technical expertise and requirements. There are 3 ways to add meta tags in WordPress, and we’ll see the step-by-step process for each of them.

Method 1: Adding Meta Tags in WordPress Manually

When we talk about manually adding the meta tags in WordPress, the process is performed using ‘header.php’, a file located in the WordPress root directory

Since you’re going to be making changes to your theme files, I recommend you create a backup of your WordPress website. So, it would be possible to restore your site in case something goes wrong. And use a child theme to make sure you don’t lose your modifications during theme updates.

Step 1: Log into your WordPress admin dashboard

Step 2: Navigate to “Appearance” and select “Theme File Editor”.

how to add meta tags in wordpress-method1-step2

Step 3: Now, from a list of theme files, locate “header.php” and open it with a text or code editor.

how to add meta tags in wordpress-method1-step3

Step 4: Inside the ‘header.php’ file, locate the ‘<head>’ section. This section typically contains the opening ‘<head>’ tag and various other meta tags and links.

Step 5: Add your custom meta tags between the <head> and </head> tags. For example, to add an Open Graph meta tag for an image, you can use the following code:

<meta property="og:image" content="https://example.com/your-image.jpg">

Replace “https://example.com/your-image.jpg” with the actual URL of your image and adjust the properties and content as needed for other meta tags.

Step 6: After adding the desired meta tags, click the “Update File” button to save your changes to the ‘header.php’ file.

how to add meta tags in wordpress-method1-step6

Now, to ensure that your custom meta tags are correctly added to your website, visit the best browser for WordPress development. Right-click on the website and select “Inspect” to view the page’s source code. There, you can confirm that the meta tags are present in the ‘<head>’ section.

If you’re using a WordPress caching plugin like W3 Total Cache or WP Super Cache to clear the WordPress cache so that changes take effect immediately.

Manually editing theme files like header.php requires a basic understanding of core WordPress development. Mistakes in the code can break your website. So, if you don’t have the necessary skills and experience, I suggest you opt for our WordPress development services.

Method 2: Using functions.php

This step is almost similar to the first one, except for the PHP code functions and WordPress hooks used to insert the meta tags into your website.

Again, if you are going with functions.php to add meta tags in WordPress, make sure you take a backup of your website. And, of course, use a child theme for more customization, flexibility, and security in case of updates.

Let’s start the process of adding meta tags in WordPress using functions.php.

Step 1: Access the WordPress admin panel.

Step 2: Navigate to “Appearance” and select “Theme File Editor”.

how to add meta tags in wordpress-method1-step2

Step 3: From the file list on the right-hand side, locate and select “functions.php”.

how to add meta tags in wordpress-method2-step3

Step 4: Open the “functions.php” file with a text or code editor, and add your custom meta tags. 

function add_custom_meta_tags() {
    echo '<meta name="description" content="Your meta description here">';
    echo '<meta name="keywords" content="Your meta keywords here">';
    // Add more meta tags as needed
}
add_action('wp_head', 'add_custom_meta_tags');

Step 5: After adding the desired meta tags, click the “Update File” button to save your changes to the ‘functions.php’ file.

Step 6: To ensure that your custom meta tags are correctly added to your WordPress site, visit the pages where you added them.

Step 7: If using a caching plugin, make sure to clear the cache on your WordPress website to ensure that your changes take effect immediately.

Now, as the name suggests, ‘functions.php’ directly impacts the way your WordPress website functions. So, if you don’t have the necessary coding skills and experience, consult with dedicated WordPress experts. Or you can opt for an SEO or meta tag plugin to make the process a little easier.

Method 3: Adding the WordPress Meta Tags Through Plugins

Plugins are like the Swiss Army Knives that equip you with a range of skills and functionalities to tackle various tasks effectively. That includes the ability to add meta tags in WordPress websites. 

SEO plugins like Rank Math, Yoast SEO, and more help simplify adding and managing meta tags, making them user-friendly for WordPress users. Or you can use a dedicated plugin like Meta Tag Manager.

Here, we’ll see how to add meta tags in WordPress using the plugin “Meta Tag Manager”.

Step 1: Log into the WordPress admin.

Step 2: Navigate to “Plugins” and click “Add New”.

Step 3: Search for “Meta Tag Manager.”, click “Install Now”, and then “Activate”.

Step 4: After activating the plugin, you’ll find a new menu item called “Meta Tag Manager” in your WordPress dashboard. Click on the WordPress plugin’s setting to configure them.

In the settings screen of this plugin, you’ll see five sections: Custom Meta Tags, General Options, Open Graph (for open graph tags), Structured Data (Schema), and Site Verification, along with “Pro Features!”.

how to add meta tags in wordpress-method3-step4

Step 5: In the “Custom Meta Tags” section, there lies an option to “Add Meta Tag”. Click on it.

That will open up a bunch of settings to add meta tags on WordPress websites.

Tag Type: The tag type specifies the purpose or category of the meta tag you’re adding. It helps you choose the right type of meta tag for your specific use case. Some common tag types include:

  • meta (Generic meta tag)
  • title (Title tag)
  • link (Link tag)
  • script (Script tag)
  • style (Style tag)
  • og (Open Graph tags for social media)
  • twitter (Twitter Card tags)
  • jsonld (JSON-LD structured data)

Name Attribute: The name attribute, also known as the property attribute for Open Graph tags, specifies the name or property associated with the meta tag. This attribute helps search engines, social media platforms, and browsers understand the purpose of the tag. For example:

  • name= “description” for the meta description tag.
  • property= “og:title” for the Open Graph title tag.
  • name= “keywords” for the meta keywords tag (though it’s not commonly used anymore).

Value Attribute: The value attribute contains the actual content or value of the meta tag. This is where you provide the specific information you want to convey through the tag. For example:

  • content= “Your meta description text here” for the meta description tag.
  • content= “Your website title” for the title tag.
  • content= “https://example.com/your-image.jpg” for the Open Graph image tag. 

These attributes work together to define the purpose and content of each meta tag you add using the “Meta Tag Manager” plugin. Plus, you have to specify “Where to display this tag”.

By specifying the tag type, name (or property), and content, you can control how your website’s information is presented to search engines, social media platforms, and other online services.

This plugin lets you add as many meta tags in your WordPress website as you want. After customizing the settings according to your requirements, click on “Save Changes”. That will add meta tags to WordPress. 

FAQs on How to Add Meta Tags in WordPress

Can I add custom meta tags to WordPress pages or posts?
Yes, you can add custom meta tags to WordPress pages or posts using plugins like Yoast SEO or by manually editing your theme's template files. Custom meta tags allow for more precise control over metadata for specific purposes.
Are meta keywords tags still important in WordPress for SEO?
No, meta keywords tags are no longer considered important for SEO in WordPress. Major search engines like Google do not use them as a ranking factor. Focus on meta titles, meta descriptions, and relevant content instead.
Is it possible to add meta tags to specific pages or posts in WordPress and not to all pages?
Yes, you can add meta tags to specific pages or posts in WordPress. You have control over meta tags on a per-page or per-post basis, allowing you to customize them individually to match the content and purpose of each page or post.

Conclusion

Adding meta tags in WordPress might seem minor, but it’s a powerful tool for getting noticed by the right audience. By customizing your titles and descriptions, you’re giving search engines clear, specific information that can drive relevant traffic straight to your site.

Whether you use a plugin or do it manually, remember that each meta tag is an opportunity to connect with users before they even land on your page. Take control of your metadata, keep it relevant to your content, and you’ll see it pay off in higher click-through rates and better engagement.

If you need further optimizations to improve your site’s visibility on search engines, hire our SEO experts.

Make your website stand out from the competition!

author
Jigar Shah is the Founder of WPWeb Infotech - a leading Web Development Company in India, USA. Being the founder of the company, he takes care of business development activities and handles the execution of the projects. He is Enthusiastic about producing quality content on challenging technical subjects.

Leave a comment