How to best add the WordPress meta description

How to best add the WordPress meta description

The easiest way to add meta description on WordPress: install SEO by Yoast and use the box at the bottom of the page to enter the text.

How to enter the meta description.

The meta description tag is not used by Google to position the web page but to display a description in the serp. Which is often even supplanted by a appropriate text, according to Mountain View, to showcase the content.

That is why it is vital to improve the click-through rate. And it is just as important to add, insert and modify this text. Now I will explain how to do it.

How to put the meta description on WordPress

The meta description is a meta tag, a text of approximately 160 characters that describes the Page content for the search engine. It is located in the section HTML code and before .

the description of the meta tag it is not visible to the eye but to the search engine which extrapolates it and uses it in the serp results. This creates the snippet with the title tag, ai annex link and toUrl.

But how to modify and insert the meta description according to the principles of SEO writing and the good optimization of a web page WordPress.

Enter the WordPress meta description without plugins

Let’s start with a technical solution: is there a way to create a meta description field without using plugins and other elements to extend the possibilities of the content management system? Yes, in fact, the solution is simple for webmasters:

  • Back up the site for security reasons.
  • Go to the dashboard.
  • Go to your site editor.
  • Open the functions.php file.

You can take this path even with FTP by going to the folder wp content / themes. At this point, you need to insert a string before the php?>.

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');

This way you can love add field meta description WordPress without plugins. And on all pages, both in articles and in categories. Be careful, don’t improvise.

Before making such a decision, make sure have the skills to do this action and to make a backup. If in doubt, go to the next option.

Edit wordpress meta description with a plugin

the first step to do for those wondering how to get into the meta ofscription of the site is simple: you must install a plugin capable of modifying this WordPress meta tag.

Among the most famous that I recommend WordPress SEO by Yoast , Rankmath and All In One SEO Pack. You can also use the simpler Slim SEO. These extensions allow you to insert text to use as an SEO meta description.

Here’s how to edit the meta description.

In fact, the plugins in question activate a dashboard at the end of the post with a series of fields. One is dedicated to tag title and one to the meta description. Very easy.

There is also one dedicated area to the creation of a SEO friendly URL. To add the day H1Instead, just use the element dedicated to the title you find.

Read: come modificare snippet WordPress

Enter the meta description for pages and articles

On the SEO guide, you find the need to modify and improve the meta description with URL tag title to optimize the extract of pages and articles. How to do?

Enter the meta description for pages and articles
Pay attention to the details of SEO.

To insert the meta description in these cases, create one new publication and go to the last part of the article or the fixed page: here you will find the box of the plugin you have installed. Add text with these characteristics:

  • About 160 characters.
  • Simple and readable.
  • Without list of keyword.
  • Able to invite to click.

If possible, use the most important keyword, even if it does not help SEO positioning it becomes more recognizable thanks to the boldness that appears in the Meta Description if the query matches the keyword used in this SEO writing element.

Clarification: the meta description should not be confused with the keyword meta tag, a function still present but totally useless for positioning purposes.

Add a meta description on the home page

Clear. it is easy to add the description in each article, but is it the same for the other pages? How to enter e use this meta tag on the home page?

wordpress seo by yoast
Here you can enter the meta description on the homepage.

If you are using WordPress SEO by Yoast you should go to the general section dedicated to titles and meta tags. Here is an entry for modify the meta description and enter the text you are missing, essential to present yourself in the best possible way.

Someone doesn’t see the section dedicated to changing the homepage meta description. The reason? Maybe the template provides a fixed page and not a sequence of articles. So go to edit page link to change this item.

Modify the meta description of author pages

I can insert wordpress keyword also for the pages of the authors of Publish? Yes it’s possible. You must go to the Users page and choose the sole author.

Modify the meta description of author pages
Example of SEO meta description by author.

Then on the specific page you will find at the end i Yoast SEO fields. They are a little different from the usual ones but the mechanism is similar: add both the tag title as the description.

Read: how to enter keywords in WordPress?

Edit the description of categories and tags

The same goes for pages and articles: you have to change or insert the meta description text on the WordPress Yoast plugin. WordPress allows you to modify the on-page SEO also taxonomies and at the end of each page dedicated to tags and categories you find the same dashboard where you can edit the WordPress meta description.

Edit the description of categories and tags
Pay attention to how variables are used in the meta description.

In this case, however, it must be remembered that the categories have a pagination and therefore other pages that follow the main ones practically identical. The risk is to create description of the meta tag duplicate. How to avoid this point?

It may solve the problem using Yoast variables: allows to follow the pagination in order to add an element which always changes.

Here is an example of a category meta description.

In order to inform the user that this is the second page of another problem. Do you have any questions regarding these points on the SEO meta description?

Source link

Leave a Reply

%d bloggers like this: