0

I have troubles using meta tag within Wordpress post-making environment. I wish to give it for first paragraph of each article and in the searching it will show only description and image thumbnail.

However, when I click publish, or just switch from text editor to visual editor, it deletes it all and leaves empty line. Tag looks like:<meta name="description" content="wwwwwwwwww"</meta>

Any way not to make it disappear? Or any other way to make it work? My main reason to put it there is SEO.

Thank you for your help, Karel

1 Answer 1

1

Do not add meta tags in post editor. Best way to do is use SEO plugins.

Best plugin for SEO is Yoast Seo

Or add this code in your themes header.php just after title tag.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.