How to Add Meta Tags in WordPress

One of SEO’s major items is meta tags. If you correctly learn methods to add meta tags in WordPress, your article or blog will surely have higher chances to rank on the top of the search list.

Today we feel the need to share with you details on meta tags and how to add meta tags in WordPress easily.

What are Meta Tags?

A meta tag is an HTML fragment that identifies a website or Web page information. This data bits inform the search engines about the website and the content that is shown in the output of the search engine.

How to Add Meta Tags in WordPress

They list relevant data about the web page or post, such as the author, keywords, description, type of document, copyrights, and other key information that you think is important to your page. The key meta tag is the meta summary tag.

Here are the examples of Meta description tags:

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

As before, Google had shown the meta-description tag with under 150 words, but it’s now 300. So there is more room for you to add the content to it.

Meta Tags have Three Main Parts

You may formulate your SEO site structure by applying three main components of meta tags.

Title: The title tag is the text displayed in the search results. Although it is not precisely a meta tag, it works and is important. And a good title affects the click rate of the site.

Description: You want to have an adequate overview for your website with the meta description tag. You want to clarify what you are selling and what you are doing. Please notice, that most of the search engines only read up to a certain quantity of characters.

Keywords: You will want to put all the relevant keywords on your website in the meta keywords tag. This helps you reach the top of the SERPs if they are properly used. Keywords are very important because the users of your website should know exactly what the content of these sentences is.

The key value and role of meta-tags is to help search engines read and compare all the information on your website.

Why Are Meta Tags Important?

It is important and must be almost included in the SEO process on the website. The more you improve it, the more search engines like your page.

The search engines will search for the required details for users on the basis of the meta tags and the content of the post. If the search results pages contain important keywords, the page or post will be raised. It should therefore be informative and involve keywords. If you can put the keyword on the first of the description, it would be healthier for SEO.

In addition, it occurs in the web results pages, such that the web is streamlined and terms are included in their meaning.

How to Add Meta Tags in WordPress Without Plugins?

There are various WordPress plugins that can build websites and post meta tags. However, the use of too many plugins on the server will lead to slow loading for your WordPress website. Therefore, we will teach you easiest ways to Add Meta Tags in WordPress Without Plugins.

By following basic steps below, you can add Meta Tags in WordPress:

  1. First, you need to go to wp-content/theme the folder
  2. Search and open the functions.php file
  3. Now, add the following code to the functions.php file
  4. Save the changes
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');

Add the code below in the functions.php file if you need to add a meta keyword tag. Please note that the search engines do not use the keyword tag in great measure. So please do it with caution.

function gretathemes_meta_tags() {
    echo '<meta name="meta_name" content="meta_value" />';
add_action('wp_head', 'gretathemes_meta_tags');

Until closing php tags, please note that the above code lines should be added? >

Additionally , please repeat measures in functions.php in your new theme as you decide to select a new theme.

How to Add Meta Tags in WordPress Using Plugins?

Rank Math

As the young kid on the block, Rank Math is a new SEO Plugin with all those essential features. This plugin is named by the team “Swiss Army Knife of WordPress SEO,” and really, it is a worthy title. The number of options and functionality this plugin provides is pleasantly unexpected. The best advantage of this plugin is the ability to provide all those features for free.

How to Add Meta Tags in WordPress

Add Meta Tags in WordPress Using SEO Plugin

If you use a SEO Plugin, adding meta tags will be easy for you.

Add Meta Tags in WordPress Using SEO Plugin

Things are similar for all other SEO Plugins

Moreover, you can also use code in order to add meta description tags to your website. You just need to add the following shortcode inside the <head> tag.

<meta name="description" content="Place the meta description text here.">

Sum Up

Congratulations, you have finally learned How to Add Meta Tags in WordPress with or without using plugins. Moreover, some of the visitors also asked us about How to Fix the Updating Failed WordPress. Do check the dedicated article on this.

We accept any type of suggestions from the visitors because it always motivates us to improve. Feel free to comment below.

Leave a Comment