How To Add Meta Tags In WordPress Without A Plugin

In SEO, meta descriptions and adding keywords are essential. These will help people to know what your website is all about without scrolling all through the pages. ? This article will help you to know how to add meta tags in WordPress without a plugin.

When you follow the correct SEO instructions regarding your meta tags’ structures, you can reach the first page in the search results. If you then optimize your meta descriptions according to the SEO rules, you’ll reach organic traffic in no time.

One of the challenges you might encounter in WordPress is that it doesn’t have built-in support for meta tags. This means you need to optimize it on your own. When you go through a different website, you will see that website owners have different ways of putting meta tags on their pages.

You can edit the meta descriptions on the codes directly, or you can install a third-party plugin for that purpose. However, the following will help you how to add meta tags in WordPress without a plugin.

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 essential as the title tag. It is the text where 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, 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

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 how to add meta tags in WordPress without a plugin

1. What are meta tags, and why are they essential for WordPress websites?

Meta tags are tidbits of code that educate search engines and social media platforms about a web page. They facilitate the comprehension of a page’s content by search engines and social media platforms, which can enhance both visibility and search engine ranking.

Because they can have a substantial impact on website traffic and engagement, meta tags are crucial in WordPress.

2. How do I add meta tags in WordPress without using a plugin?

By manually modifying the header.php file located in your theme’s directory, you can add meta tags to your WordPress website without the use of a plugin. Simply add the necessary meta tags to the file’s head section by opening it in a text editor.

Before attempting this procedure, which involves some coding knowledge and takes time, you must make a backup of your website.

3. What is the difference between meta tags and meta descriptions?

Both meta tags and meta descriptions are types of metadata that educate search engines and social media platforms about a web page. Meta descriptions, on the other hand, are specific to the content of the page and are normally constrained to 155–160 characters.

Meta tags, on the other hand, are more general and can include a range of information. In search engine results, meta descriptions frequently appear below the page title.

4. Can I add meta tags to individual pages or posts, or do they apply to the entire site?

You can add meta tags to specific pages or posts in WordPress by modifying the header.php file or by utilizing a plugin that enables per-page or per-post meta tag addition. On the other hand, some meta tags, like the site title and description, apply to the entire website and may only be modified there.

5. What is the recommended length and format for meta tags in WordPress?

Depending on the type of tag, different lengths and formats for meta tags are advised in WordPress. For instance, the description tag shouldn’t be longer than 155–160 characters, whereas the title tag should be between 50–60 characters.

Most search engines no longer employ meta keywords, and they are no longer advised. To ensure that search engines and social media platforms can properly understand each tag, the proper structure must be used.

6. Are there any SEO best practices I should follow when adding meta tags to my WordPress site?

It’s crucial to adhere to SEO best practices when adding meta tags to your WordPress site, such as utilizing distinct and descriptive tags for each page or post, containing pertinent keywords, and avoiding keyword stuffing.

Also, it’s crucial to make sure your tags appropriately reflect the content of your page or post and to keep the length of your tags within the suggested ranges.

7. Can I preview how my meta tags will appear in search results before publishing them?

Sure, using tools like Google’s Search Console or the Yoast SEO plugin, you can see a sample of how your meta tags will look in search results. Before publishing your page or post, you may use these tools to preview how your title and description tags will appear in search results and make changes as necessary.

8. Is it possible to edit or update meta tags for existing WordPress pages or posts?

Yes, you can add or update the meta tags for already-existing WordPress pages or posts by making changes to the header.php file or by installing a plugin that lets you edit meta tags for individual pages or posts. It’s important to remember, though, that altering your meta tags may affect both your search engine rating and social network visibility.

9. How do I verify that my meta tags are working correctly on my WordPress site?

With tools like Google’s Search Console or the Yoast SEO plugin, you may check that the meta tags on your WordPress website are functioning properly.

With the help of these tools, you can make sure that search engines and social media platforms are correctly understanding your tags and that they display as intended in search results and social media previews.

Also, it’s a good idea to frequently analyze the traffic and engagement metrics of your website to check for any adjustments that would point to a problem with your meta tags.

10. Are there any WordPress themes or templates that automatically add meta tags, or do I need to do it manually?

Several fundamental meta tags, like the site title and description, are automatically included in a lot of WordPress themes and designs. To make sure that these tags appropriately reflect the content of your website, it is still crucial to evaluate and modify them as needed.

Certain WordPress plugins, like Yoast SEO, can assist with automating the process of adding and modifying meta tags.

Ending thoughts on how to add meta tags in WordPress without plugin

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.

When you have meta tags on your website, it will help the search engine crawlers to find your metadata information. In return, your website will become SEO-friendly, making it available to different types of people online.

Ensure that your meta tags are clear and understandable to make it easier for crawlers to find your content. Eventually, it affects how your content or website will look like on SERPs. Finally, you don’t need to go through different plugins to create your meta tags. By following these steps, you are taking the right path for your website’s success.

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