• Article

How to add a meta tag to WordPress

  • October 14, 2022
  • 7 min

WordPress meta tags are a very important tool for you to be found in Google and achieve top ranking.

Meta Tags are used for search engine optimization and are part of WordPress SEO. Title and Description tags ensure that your visitor and Google immediately know what the page is about.

Setting tags on WordPress

By default, you can’t store meta tags such as the title and description on WordPress. Your best option is to install the YoastSEO plugin. This gives you an editing window with which you can insert the title and description SEO.

On the homepage, on all subpages, and in all articles (compositions) of the blog, you should set the following WordPress meta tags:

  • title
  • description
  • Keywords

YoastSEO shows the optimal number of characters you should use for the title and description. In addition, this plugin offers you many other useful features for WordPress SEO.

What is Title?

The title is the most important meta tag. The title appears on every page and is also displayed in Google search results.

how title looks like in Google
This is title on search results page

The plugin also shows whether the length of the header is correct with a coloured bar. You can orient yourself very well on this:

  • Orange = Too short
  • Red = Too long
  • Green = Very Good
 title in RankMath plugin
This is the title in RankMath plugin

What is Description?

You will not see the meta description of the tag on the website itself. It only shows up in a Google search. However, it is very important for this.

Next to the title, the description is what the visitor sees. The better and clearer the description, the more clicks on the search results

description in RankMath plugin
This is the description in RankMath plugin

Important: Google doesn’t care what’s in the description. The content of the description is not evaluated and therefore does not get ranked by Google.

However, a good description ensures that people click on this search result. This will bring you more visitors. It also increases the CTR (click-through rate). This is a positive signal for Google and gives you a plus.

Therefore, even if Google does not rate the content of the description, it is the description that counts.

Why should you edit the meta description?

With the meta description, you define the flagship of your website in search engines. Their design affects how often visitors click on your page, and is therefore an important part of search engine optimization (SEO).

Therefore, if you improve the meta description on WordPress, it will increase the number of clicks, and more visitors will learn about your website. All this is worthwhile not only quantitatively, but also qualitatively: if you tailor your meta-descriptions to your desired target group, you will reach more relevant visitors, who will also deal with your website content longer.

Meta Tags in search results

Now I would like to talk more about the 2 most important WordPress meta tags “Title” and “Description”. These two are featured in Google searches.

The title influences rankings and of course the behaviour of your visitors. It’s important that you put keywords in the title and make this line as interesting as possible.

What is written in the description is now completely irrelevant to Google itself. Thus, the text has no effect on the ranking. Nevertheless, the description text is still very important.

Because the text in the description is also decisive for whether your page is clicked or not. The higher the clickability on your website, the faster you will rise in the rankings. And that’s why the description is extremely important, even if Google itself doesn’t care what it says here.

How do I add meta tags to WordPress using plugins?

Yoast SEO

By far the most famous SEO plugin “Yoast SEO” evaluates your content for previously defined keywords and gives you basic readability feedback. First, install and activate the plugin. Then switch to edit mode for any post or page on WordPress.

Underneath the text editor you will find the new Yoast interface. In doing so, you can set the main keyword for which your message should be checked. Below you will already find fields for editing the meta description.

In the example, the meta description is still unedited. The purple buttons in the “SEO Title” area are placeholders that have been generated from the page title. You can remove them and set a custom title.

The same applies to the WordPress permanent link and the meta description below. The colour bar shows live how many characters of the description are still visible to the visitor.

Rank Math

First, click on the “Title and meta” entry in the new WordPress menu item “Rank maths“. There, you can set global meta parameters that apply to your entire website. These include, among others, indexing type, separators, or thumbnail graphics in social media links.

If you want to assign a basic structure to your meta descriptions, you can configure it in the other sub-items “Posts” and “Pages”. Here, RankMath offers a selection of different placeholders that arise from the page properties.

To customize the meta description in a single post, open the details’ menu (three dots) in the Gutenberg editor and click on the “Rank Mathematics” item. A new sidebar now opens where you can edit the meta-snippet and set the focus keyword. In addition, the plugin shows you an SEO checklist that checks your contribution for relevant factors.

How to add meta tags to WordPress without a plugin

If you want to do without using SEO plugins to edit the meta description on WordPress, of course there is also a manual way. However, we generally recommend the MIT plugin, as it’s much simpler and easier for most to implement.

Important note

Please back up your website before these steps, and it’s best to use a child theme to protect the functionality of your page in case of errors.

First open the Theme Editor entry through the Design menu and open the header.php file in the sidebar. In the <head> tags you then insert the following code:

<meta name="description" content="" />

Now add the desired meta description between the inverted commas content=”” to display it as a whole on all pages. With a small code extension, search engines can also automatically pick up the title and description of posts:

<meta name="description" content="<? php if ( is_single() ) { single_post_title('', true); } else { bloginfo('name'); echo " - "; bloginfo('description'); }

How to add meta tags for social media

For Facebook as well as Twitter, there is an additional setting in Yoast SEO. By the way, these so-called open graph settings also apply to XING and LinkedIn.

When using YoastSEO Premium, the name and description of social networks are automatically copied and inserted from your title and description. If you are using the free version of YoastSEO you have to do this manually.

How to add meta tags to AMP pages

How to add a meta description tag to our AMP pages. In particular, an example of how to include a meta description tag generated by the Yoast SEO and All In One SEO Pack plugins.

These two SEO plugins are probably the most commonly used. They store vital information for creating the tags needed to optimize the SEO of your entries in custom fields. For meta description, Yoast SEO uses a custom field called _yoast_wpseo_metadesc, and AIOSP uses a custom field called_aioseop_description.


<!doctype html>
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); // WPCS: XSS ok. ?>><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<?php do_action( 'amp_post_template_head', $this ); ?>
<style amp-custom>
<?php $this->load_parts( array( 'style' ) ); ?>
<?php do_action( 'amp_post_template_css', $this ); ?>
</style>
</head>
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?>">

Next, create a meta description tag and embed it in the header of AMP pages. The official AMP plugin includes an html-start.php file with the following contents in its templates:

As you can see, the AMP plugin for WordPress makes hookamp_post_template_head available to us. This is where we create and enter the meta description tag.

If you are using the Yoast SEO plugin, the code you should add to your theme’s functions.php file or to the utility plugin looks like this


<?php
function add_yoast_seo_description_to_amp_pages( $amp_template ) {?>
<meta name="description" content="<?php echo esc_html( get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true ) );?>" />
<?php }add_action( 'amp_post_template_head', 'add_yoast_seo_description_to_amp_pages' );


If you are using the AIOSP plugin, the code you should add to your theme's functions.php file or to the utility plugin is as follows

<?php
function add_aiosp_description_to_amp_pages( $amp_template ) {?>
    <meta name="description" content="<?php echo esc_html( get_post_meta(get_the_ID(), '_aioseop_description', true ) );?>" />
<?php }
add_action( 'amp_post_template_head', 'add_aiosp_description_to_amp_pages' );


Ten hints to know how to optimize the meta description

1. Be sure to pay attention to the length of the description!

In standard search results via desktop or laptop, the meta description contains a maximum of 130-160 characters, the title, in turn, a maximum of 70 characters.

Note: on mobile devices, the maximum number of characters is logically slightly lower due to the smaller screen. Most internet users now make searches via smartphone or tablet – so the meta description on WordPress also needs to be readable in mobile view and make sense.

2. Describe the benefits clearly

If you want to be at the top of Google search results, you must also make it clear to your potential visitors what they can expect from you. 

3. Present yourself as an authoritative source

If you regularly write blog posts on a particular topic, position yourself in the meta description as an “expert blog” that competently answers that particular user question.

It is in the user’s own interest to first look for a reliable and competent source. 

4. Integrate social trust 

Opinions and ratings from other users are a particularly common tool. When in doubt, most people choose a product when shopping online that is particularly popular with other visitors and has many positive reviews.

5. Pay attention to keywords in the title and description

Search engine optimization itself is a small science, and the weighting of different factors changes at regular intervals for search engines.

However, the consideration of keywords will always retain a key role. Finally, keywords express the intent of a search query – the more specific, the less search volume becomes.

6. Use emoji

When competing for users’ attention, you’re usually competing with many other websites. To stand out a little more in terms of visibility, special characters may be a suitable option.

Emoticons are increasingly being used, many of which can now be viewed on Google. On the GetEmoji website, you can copy all the relevant emoticons and paste them into your meta description. In addition, numbers and brackets are also often used to highlight the meta description.

Use emoticons that actually catch the visitor’s attention

7. Also use clickbait

By Clickbait, we mean not completely exaggerated headlines in this context, from which there is ultimately nothing in terms of content. However, to generate more clicks on your website, especially at the beginning, you can also encourage the visitor to click with somewhat creepy text in the meta description.

Many online marketers use pain or reward principles. This means that, for example, the headline of a post evokes a certain emotional state in the viewer.

8. Integrate the call to action

Use a directly worded invitation to click on the link either at the beginning or at the end of the meta-description. You can also formulate the request in such a way that it corresponds to a previously formulated benefit for the visitor.

Ideally, you complement with terms such as “Now” to create urgency in your mind – for example, “Click now and become a WordPress professional!”

9. Keep what you promise

The quality of your content should live up to what you previously promised in your meta description. If you fail to meet your visitors’ expectations, they will disappear from your site within seconds.

If this so-called bounce rate accounts for a significant proportion of visits to your website, it has a negative impact on your search engine results. So stay authentic and provide only quality content with added value to the user.

10. Prioritize your pages

If you’ve had a website for a long time, you’re probably wondering, “Now do I need to adjust the meta description on each of my pages?”

The answer to that question is mostly yes. Even though meta descriptions are not a ranking factor in Google, they are indirectly responsible for the organic click-through rate on your website, and in the end it affects your Google ranking.

Since this takes quite a long time depending on the volume, focus first on the pages that get clicked on most often.

Conclusion

Editing meta descriptions on WordPress is not rocket science. So take plenty of time to optimize your website’s symbolic storefronts. Feel free to write a comment if these tips have helped you and how they have improved the number of clicks on your site.

FAQ – Frequently Asked Questions about WordPress Meta Description

  • What happens if I don’t add a meta description?

    Typically, search engines such as Google will select the page title and show the most relevant part of the linked page in the description.
  • What is the difference between a meta description and a meta keyword?

    The meta-description includes all characters that can be seen in a search result. Ideally, you include the relevant meta-keyword in the description. With keywords, you increase the relevance of your meta description.
  • What’s the difference between meta description and WordPress tags?

    So-called tags on WordPress are not visible to search engines. However, on your website, they give visitors a quick classification of what topics are covered in the post. Tags can also be used to find content-related pages that may also be of interest to the user.

Head of Rush Analytics Dmitry
Views
670
Rating
0,0/5
Rate
Comments
0
Comment
Rate this article Rating anonymous
Add a comment

Other articles

Back to blog

Get 7 days free trial access to all tools.

Pick the right keywords from Google, YouTube and Yandex suggestions

Free Trial