How to Add Meta Tags in WordPress: A Complete Guide

How to Add Meta Tags in WordPress: A Complete Guide - The White Label Agency

Meta tags play a crucial role in WordPress SEO by helping search engines understand your content and improving your site’s visibility in search results. They can influence rankings, enhance click-through rates (CTR), and ensure your pages are displayed correctly when shared on social media.

If you’re wondering how to add meta tags in WordPress, this guide covers everything you need to know. Whether you prefer using an SEO plugin or manually inserting meta tags, we’ll walk you through each method step by step.

What Are Meta Tags?

What are meta tags

Before diving into how to add meta tags in WordPress, it’s important to understand what they are and why they matter. Meta tags are snippets of HTML code embedded in the <head> section of a webpage. They provide metadata (information about a page) to search engines and browsers, influencing how your content appears in search results and on social media platforms.

Types of WordPress Meta Tags

Different types of meta tags serve various purposes. Here are the most commonly used ones:

  • Meta Title – Defines the title displayed in search engine results and browser tabs.
  • Meta Description – Provides a brief summary of the page content, influencing click-through rates.
  • Meta Keywords – Historically used to indicate relevant keywords, but now largely ignored by major search engines.
  • Robots Meta Tag – Instructs search engines on how to index or follow links on a page.
  • Viewport Meta Tag – Ensures proper display on mobile devices by controlling page scaling.
  • Open Graph Tags – Used for optimizing content appearance when shared on social media platforms like Facebook and X.

Meta tags help improve your site’s SEO, but they must be correctly implemented to be effective.

SERVICES

WordPress maintenance plans

WordPress Maintenance Plans ensure site security, performance, and uptime. Choose custom plans with backups, monitoring, and unlimited content edits.

Preparing to Add Meta Tags in WordPress

Now that you understand the importance of meta tags, let’s ensure your website is ready for modifications. Before making any changes, taking a few precautionary steps can help prevent errors or data loss.

Backup Your Website

Before modifying your WordPress theme or adding new plugins, creating a full backup is essential. This ensures that you can restore your site in case something goes wrong.

  1. Using a Plugin – Popular backup plugins like UpdraftPlus allow easy site backups with one click.
  2. Manual Backup – Download your website files via FTP and export your database using phpMyAdmin.
  3. Hosting Provider Backups – Some hosting providers offer built-in backup options, making it convenient to restore data when needed.

Understanding Child Themes

If you plan to add meta tags manually, editing your WordPress theme files directly isn’t recommended. Updates to your theme can overwrite your modifications. Instead, using a child theme ensures your changes remain intact.

How to Create and Activate a Child Theme

  1. Navigate to your WordPress directory via FTP or File Manager.
  2. Create a new folder inside wp-content/themes/ and name it after your main theme (e.g., theme-child).
  3. Create a style.css file in this folder and add the following code:

CSS

/*
Theme Name: Your Theme Child
Template: your-theme
*/

  1. Activate the child theme in the WordPress dashboard under Appearance > Themes.

With backups in place and a child theme activated, you’re now ready to start adding meta tags to WordPress.

Adding Meta Tags Using Plugins

For most users, the easiest way to add meta tags is by using an SEO plugin. These plugins offer a user-friendly interface to manage meta titles, descriptions, and Open Graph tags without needing to edit code.

Choosing the Right Plugin

There are several SEO plugins available, but three of the most popular choices are:

Plugin NameFeatures
Yoast SEOUser-friendly, automated meta tag generation, XML sitemaps
All in One SEOAdvanced settings, structured data, local SEO integration
Meta Tag ManagerAllows custom meta tag insertion beyond standard SEO tags

Choosing the right plugin depends on your needs. If you’re looking for an all-in-one SEO solution, Yoast SEO or All in One SEO are excellent choices. If you need to add custom meta tags, the Meta Tag Manager plugin is a good option.

Installing and Configuring Yoast SEO Plugin

Yoast SEO is the most widely used plugin for adding meta titles and descriptions in WordPress. Here’s how to set it up:

  1. Go to Plugins > Add New in your WordPress dashboard.
  2. Search for “Yoast SEO”, then install and activate the plugin.
  3. Navigate to SEO > General to configure the basic settings.
  4. Enable meta tag settings under SEO > Search Appearance.
  5. Edit a post or page, scroll down to the Yoast SEO box, and enter your meta title and meta description.

Using Meta Tag Manager for Custom Meta Tags

If you need more flexibility, Meta Tag Manager allows you to add custom meta tags to specific pages.

  1. Install and activate Meta Tag Manager from the WordPress plugin directory.
  2. Go to Settings > Meta Tag Manager and add new meta tags.
  3. Choose where to apply them – globally, to specific pages, or post types.
  4. Save changes and test your site to ensure the tags are working.

By using SEO plugins, you can efficiently add meta tags in WordPress without dealing with code. However, if you prefer full control, you may want to learn how to add meta tags in WordPress without plugin, which we’ll cover next.

Manually Adding Meta Tags in WordPress

How to add meta tags in WordPress without plugin

While plugins offer a simple way to manage meta tags, some users prefer how to add meta tags in WordPress without plugin for more control and minimal reliance on third-party tools. This method requires modifying your theme files, so it’s essential to proceed carefully.

Editing Theme Files

One way to manually insert meta tags is by modifying your header.php file, where WordPress loads essential site metadata.

Steps to Edit the Header.php File

  1. Go to Appearance > Theme Editor in your WordPress dashboard.
  2. Locate and open the header.php file.
  3. Find the <head> section in the code.
  4. Insert the following meta tag examples before the closing </head> tag:

HTML

<meta name="description" content="Your custom meta description here">
<meta name="keywords" content="your, keywords, here">
<meta name="robots" content="index, follow">

  1. Click “Update File” to save your changes.

Why Use This Method?

  • Provides direct control over meta tags without relying on plugins.
  • Useful for adding global meta tags that apply to the entire site.
  • Avoids potential plugin conflicts.

However, manually editing header.php isn’t always the best option, as theme updates can override your changes. To prevent this, consider using a child theme, as discussed earlier.

SERVICES

WordPress developer for hire

Are you struggling to find the right WordPress developer for hire? Our staff of 100+ WordPress developers is available for your projects.

Using the functions.php File

For a more dynamic approach, you can use functions.php to automatically insert meta tags into every page.

Steps to Add Meta Tags via functions.php

  1. Navigate to Appearance > Theme Editor.
  2. Locate and open the functions.php file.
  3. Insert the following code at the end of the file:

PHP

function add_meta_tags() {
echo '<meta name="description" content="Your custom meta description here">' . "\n";
echo '<meta name="keywords" content="your, keywords, here">' . "\n";
echo '<meta name="robots" content="index, follow">' . "\n";
add_action('wp_head', 'add_meta_tags');

  1. Click “Update File” to save your changes.

Advantages of Using functions.php

  • Ensures that meta tags are dynamically applied across all pages.
  • Prevents losing changes when updating the theme.
  • Can be further customized to add different meta tags for specific pages.

Using functions.php is a more flexible alternative to editing header.php, especially if you’re managing multiple pages.

3 Best Practices for Meta Tags

How to add meta tags in WordPress - best practices

Now that you know how to add meta tags in WordPress, let’s go over some best practices to ensure they are optimized for SEO and user engagement.

1. Crafting Effective Meta Titles

A meta title is one of the most important ranking factors for search engines. Here’s how to create a strong title:

  • Keep it under 60 characters to avoid truncation in search results.
  • Include your primary keyword naturally.
  • Make it compelling to improve click-through rates.

Example of a good meta title

<meta name="title" content="How to Add Meta Tags in WordPress - A Complete Guide">

2. Writing Compelling Meta Descriptions

A well-written meta description increases the likelihood of users clicking on your site.

Best practices on how to add meta description in WordPress:

  • Keep it under 160 characters.
  • Include relevant keywords while maintaining readability.
  • Provide a clear summary of the page’s content.
  • Use action-oriented language (e.g., “Learn how to…,” “Discover the best way to…”).

Example of a strong meta description

<meta name="description" content="Learn how to add meta tags in WordPress to improve SEO and rankings. Step-by-step guide with and without plugins.">

3. Using Meta Keywords (Are They Still Relevant?)

Google no longer considers meta keywords a ranking factor, but some smaller search engines might. If you choose to include them:

  • Use only relevant keywords.
  • Avoid keyword stuffing.
  • Limit to 5-7 keywords per page.

Example

<meta name="keywords" content="how to add meta tags in WordPress, WordPress SEO, meta tags">

Verifying and Testing Meta Tags

Now that you’ve added meta tags to your WordPress site, the next step is to verify and test them. Proper implementation is crucial for ensuring that search engines and social media platforms interpret your meta tags correctly. Here’s how you can check if everything is working as expected.

Using Browser Developer Tools

One of the simplest ways to inspect meta tags is through your web browser’s built-in developer tools. This method allows you to quickly verify whether your meta tags are correctly inserted in the <head> section of your webpage.

Steps to Check Meta Tags in Chrome or Firefox:

  1. Open your WordPress site in Google Chrome (or any modern browser).
  2. Right-click anywhere on the page and select “Inspect” (or press Ctrl + Shift + I / Cmd + Option + I on Mac).
  3. Navigate to the Elements tab and locate the <head> section.
  4. Search for meta tags by pressing Ctrl + F and typing "meta".
  5. Review your meta titles, descriptions, Open Graph tags, and robots meta tags.

If your meta tags are missing or incorrectly configured, you may need to revisit your plugin settings or manually added code.

SEO Analysis Tools

To ensure that your meta tags are optimized for search engines, use professional SEO analysis tools. These tools help audit meta tag performance and detect potential issues.

  • Google Search Console
    • Navigate to URL Inspection Tool
    • Enter your website’s URL to see how Google reads your meta tags
    • Check for any indexing errors and request a manual reindexing if necessary
  • Screaming Frog SEO Spider (Desktop App)
    • Crawl your website and extract all meta titles and descriptions
    • Identify missing, duplicate, or excessively long meta tags
  • Ahrefs & SEMrush
    • Perform a site audit to check how well your meta tags align with SEO best practices

By using these tools, you can refine your meta tags to enhance search engine visibility.

Testing Social Media Sharing

Proper implementation of Open Graph and Twitter Card meta tags ensures your content displays correctly when shared on social media platforms.

  • X (formerly Twitter): Use the Twitter Card Validator to preview how your content appears when shared on X. Enter your URL and click “Preview Card” to see the rendered card.
  • Facebook: Access the Facebook Sharing Debugger to inspect how your page’s content appears when shared. Enter your URL and click “Debug” to see the preview and any potential issues.​
  • LinkedIn: Utilize the LinkedIn Post Inspector to check how your content displays on LinkedIn. Enter your URL and click “Inspect” to view the preview.

Common Issues and Troubleshooting

How to add meta tags in WordPress - best practices

Even with careful implementation, issues with meta tags can arise. Here’s how to address some common problems.

Meta Tags Not Displaying Correctly

If your meta tags aren’t appearing as expected:

  • Plugin Conflicts: Deactivate other SEO or caching plugins to identify potential conflicts.​
  • Theme Overrides: Some themes may override custom meta tags. Check your theme’s documentation or consult the developer.​
  • Caching Issues: Clear your site’s cache and your browser’s cache to ensure you’re viewing the most recent version of your site.​

Changes Not Reflecting in Search Engines

If updates to your meta tags aren’t visible in search engine results:

  • Indexing Delays: Search engines may take time to re-crawl and index your updated pages.​
  • Manual Reindexing: In Google Search Console, use the URL Inspection Tool to request indexing of your updated pages.​

Overriding Theme Defaults

To prevent your theme from overriding custom meta tags:

  • Child Themes: Use a child theme for customizations, ensuring updates to the parent theme don’t affect your modifications.​
  • Theme Settings: Review your theme’s settings for built-in SEO options that might conflict with your meta tags.​

Conclusion

Meta tags play a crucial role in WordPress SEO and user engagement, influencing how search engines and social media platforms interpret your content. By following this guide, you’ve learned how to add meta tags in WordPress using SEO plugins or manual methods, ensuring your site is properly optimized for search visibility and click-through rates. 

But implementation is just the first step—verifying and testing your meta tags with developer tools and SEO analyzers ensures they are working as intended. And when issues arise, troubleshooting common problems like indexing delays, plugin conflicts, and theme overrides will help maintain your site’s performance.

Keeping your WordPress meta tags updated is not a one-time task but an ongoing strategy that contributes to long-term SEO success. As search engine algorithms evolve, so should your meta tags, ensuring your content remains optimized and competitive.

If you’re a digital agency looking for a reliable partner to handle WordPress development, custom website builds, and ongoing maintenance, White Label Agency is here to help. As a trusted WordPress development partner, we work behind the scenes to deliver high-quality, custom-coded WordPress websites tailored to your agency’s needs. 

With 100+ expert developers, a strict quality assurance process, and custom solutions, we ensure your agency can scale effortlessly while delivering outstanding websites to your clients. Partner with us today, and let’s build something great together.