How To Add Meta Tags In WordPress Without A Plugin

Imagine unleashing the full potential of your WordPress site—boosting its search engine visibility without cluttering it with additional plugins. Integrating meta tags directly into your WordPress theme is not only possible; it’s a stride towards mastering SEO control from the ground up.

This concise guide delves into how to add meta tags in WordPress without a plugin, ensuring your website stands out to search engines and attracts more visitors.

By sidestepping the reliance on plugins, you enhance your site’s performance and maintain greater control over its SEO aspects.

You’ll learn the precise steps to access and modify the header.php file, embed essential meta tags, and optimize your theme files effectively.

Expect to navigate through the fundamentals of editing WordPress for SEO, direct code insertion, and tweaking your site to achieve optimal searchability and relevance. Step into a realm of coding that promises significant returns for your web visibility efforts.

What is a Meta Tag?

It is firstly important to learn the meaning of a meta tag. The meta tag shows the summary or snippet of what your page is all about to the readers.

It is one of the essential parts of your content. A search engine can crawl to your page without a problem if you optimize it with the right keywords and useful information. That’s why you need to include the meta title, meta description, and canonical URL.

To make your meta tags efficient for SEO, you should put the copyrights, type of document, description, keywords, author, and core information regarding the web page or post. Above all these meta tag inclusions, the description tag is the most important one.

The typical format of a meta tag is similar to this:

<meta name=”description” content=”This is the description sentence or short paragraph about the article or post.” />

Until recently, Google presented only 150 characters from the meta tag description. Now their latest algorithm update shows 300 characters. So you need to be mindful of your description’s number of characters.

What are Meta Tags’ Three Main Parts?

When building your SEO site structure, you need to use the three main parts of meta tags: the Title, Description, and Keywords. Using these three parts makes it easier to establish your meta tag. Eventually, you will learn how to add meta tags in WordPress without a plugin.

Title Tag

Sometimes, you cannot read the title tag on the article if the author has written the title tag and the article’s headline separately. But it is essential in the search engine. That will show up as the title in your search engine results pages. It acts as the anchor text and the main title in the social shares.

If you are writing the title tag, think of it as your overall content’s primary impression. Make it eye-catching and enticing as much as possible. It affects your site’s click-through rate.

Meta Description

A meta description is as essential as the title tag. It is the text that Google crawls in to see if it is worthy of placing into its snippet section. Moreover, it is the summary of your content. That’s why you should not leave it out when editing your content on WordPress or other host websites.

When describing your page or content, avoid fluff or fillers. Make it short and concise, so, that Google will understand the essence of your website. The meta description includes what you offer and how people can benefit from purchasing your product or service. If you are writing blogs, present all the values readers can get from your article.


Keywords are crucial in ranking your content in search engine results pages. In your meta keywords tag, you will include all the relevant and appropriate keywords to your site.

When you use it according to the rules and practical strategies, you can see better results when you check website ranking of your domain.

Furthermore, you might get featured in the Google Snippet. With the right keywords, users or readers can tell what type of content you have.

The Benefits of Meta Tags

Search Engine Crawls Through Content with Meta Tags

Meta tags are crucial to the on-page SEO process. When you optimize them according to experts’ latest techniques, search engines will favor you and might put you at the top of SERPs.

Users Can Find Your Content Without a Problem

Internet users ask questions in Google or other search engines by using relevant keywords. Studying the right keywords for your content will make it easier to get found by readers and potential leads.

It Puts Your Content in Order

With meta tags, you’ll have your meta title, description, and keywords in place. If you leave the meta tags out , you will end up with a gibberish description that will hurt your search engine optimization.

Your Post or Content Will Rank Higher

The search engine bot helps the user find relevant answers through their queries by crawling through the article’s content and meta tags. If you include appropriate and high-ranking keywords with low competition, you’ll get better results. It is best to put the keyword at the beginning of the meta description.

Up until the update of Google’s algorithm, many people abused the use of keywords. However, now Google is considering other factors to boost content’s ranking. Nonetheless, keywords are still a large factor in improving your SEO. If you use them according to their relevance, you might reach new SEO heights and maintain your SERPs ranking.

The Step-By-Step Guide on How to Add Meta Tags to WordPress Website Without Plugin

You’ll find several WordPress plugin options to create meta tags. It is alright to use them, but the disadvantage is the possibility of slowing  down your website and adding irrelevant codes in the theme’s head section.

Create metatags without using plugins to give a cleaner look to your website. Moreover, it provides a sense of fulfillment. The good news is that you can create meta tags without using plugins.

Here is the step-by-step guide:

Step 1

Head to the wp-content/themes folder and browse.

Step 2

Look for the file ‘functions.php’ and open it.

Step 3

Write the following codes to the functions.php file:

function gretathemes_meta_description() {

    global $post;

    if ( is_singular() ) {

        $des_post = strip_tags( $post->post_content );

        $des_post = strip_shortcodes( $post->post_content );

        $des_post = str_replace( array(“\n”, “\r”, “\t”), ‘ ‘, $des_post );

        $des_post = mb_substr( $des_post, 0, 300, ‘utf8’ );

        echo ‘<meta name=”description” content=”‘ . $des_post . ‘” />’ . “\n”;


    if ( is_home() ) {

        echo ‘<meta name=”description” content=”‘ . get_bloginfo( “description” ) . ‘” />’ . “\n”;


    if ( is_category() ) {

        $des_cat = strip_tags(category_description());

        echo ‘<meta name=”description” content=”‘ . $des_cat . ‘” />’ . “\n”;



add_action( ‘wp_head’, ‘gretathemes_meta_description’);

Step 4

Update and save the changes.

If you want to add a meta keyword tag to your content, you can go to the function.php file and write the codes below. Keep in mind that search engines do not usually use the meta keyword tag, but the decision is up to you.

function gretathemes_meta_tags() {

    echo ‘<meta name=”meta_name” content=”meta_value” />’;


add_action(‘wp_head’, ‘gretathemes_meta_tags’);

Add the code before the php ?> closing tags. If you are using a new theme for your website, repeat the same process as mentioned above.

FAQs about adding meta tags in WordPress without a plugin

What exactly are meta tags, and why do I need them in WordPress?

Meta tags are snippets of text that describe a page’s content; they don’t appear on the page itself but only in the page’s code. Crucial for SEO, they help search engines understand what your site is about, enhancing visibility and relevancy in search results.

How can I access WordPress to add meta tags without using a plugin?

To insert meta tags without a plugin, access your WordPress site’s files directly. Navigate to your theme’s directory, find the header.php file, and embed the meta tags right between the <head> tags.

What specific meta tags should I include for SEO optimization?

Primarily include the meta description and meta keywords tags. Make sure also to add specific title tags and schema markup if you’re aiming to optimize for rich snippets in search results, enhancing click-through rates.

Is editing header.php safe? How do I avoid breaking my site?

Editing header.php is safe if you approach it cautiously. Always back up your files before making changes. Use a child theme to prevent updates to the parent theme from erasing your edits. This way, you maintain changes securely.

Can adding meta tags directly affect my site’s performance?

Directly adding meta tags shouldn’t impede your site’s performance. In fact, by avoiding plugins for this task, you might actually improve loading speeds and overall site efficiency, as there’s less bloat from additional software.

What if my WordPress theme doesn’t have a header.php file?

If there’s no header.php file, your active theme likely manages function calls and structure differently. Check for alternative files like index.php or functions.php, or consider switching to a theme that has clearer, more accessible file structures for SEO tweaks.

How do I make sure my meta tags are effective in SEO?

Ensure your meta tags are effective by keeping them concise and relevant to your page’s content. Utilize targeted keywords and compelling descriptions. Periodically review and update your tags to align with current SEO best practices as they evolve.

How do I update meta tags across multiple pages?

For multiple pages, individually editing each header.php can be tedious. Consider using functions in functions.php for dynamic meta tag insertion. This script can programmatically adjust tags based on specific posts or pages, streamlining the process.

What are the risks of manually adding meta tags in WordPress?

The primary risk involves potential syntax errors which can disrupt site display or functionality. Double-check your code for accuracy. Also, manual updates require more maintenance versus using plugins that automatically adjust tags site-wide.

Is there a way to verify if my meta tags are set up correctly?

Yes, verify your meta tags setup by viewing your web page’s source from a browser (right-click, then select “View page source”). Search for <meta> within the source code to confirm your tags are properly implemented and visible to search engines. Additionally, utilize tools like Google’s Search Console for further analysis.


Now that you have learned the necessary code on how to add meta tags in WordPress without a plugin, you can begin creating your meta tags on your own.

As we wrap up this journey, it’s evident that how to add meta tags in WordPress without a plugin heralds an empowering path. By embedding these essential snippets directly into the header.php file, one not only enhances the site’s SEO prowess but also retains a clutter-free WordPress environment. Armed with the knowledge of manually inserting meta keywordsmeta descriptions, and schema markups, you’re set to craft a website that communicates fluently with search engines, boosting both visibility and user engagement.

  • Remember:
    • Back up files before tinkering.
    • Test changes with development tools.
    • Update meta tags as strategies evolve.

The endeavor to incorporate meta tags manually might seem intricate initially, but it’s a valuable skill that fortifies your site’s foundational SEO and streamlines its performance. Here’s to elevating your site’s presence in the digital realm, meticulously, one tag at a time.

If you enjoyed reading this article on how to add meta tags in WordPress without a plugin, you should check out this one about how to uninstall WordPress from cPanel.

We also wrote about a few related subjects like how to tell if a site is WordPress, how to hide a featured image in a WordPress post, how to embed excel in html, how to embed a pdf in WordPress, how to optimize CSS delivery in WordPress and how to create a website like Amazon.

Bogdan Radusinovic
Bogdan Radusinovic

Senior SEO and Marketing Specialist

Articles: 137