Here’s how to add WordPress meta description without plugin for homepage and single post. By adding a code in functions.php file, the meta description will be generated in the head section immediately when you publish your post.
Adding meta description automatically in WordPress through a plugin is easy. But the use of plugins to build the entire site structure is not recommended.
Below we will specify 3 php codes, one for the homepage, one for single post and another for both home page and single post. Third code is to use as a single code for both templates.
To add the meta description for homepage only, use this code in functions.php in your child theme:
See the example below. In this picture see how the code in functions.php generates meta tags in Home page and Single post.
In the post you can see the first words, the bottom of the picture.
On the right side of the picture, see how the code is located in “functions.php”.
While on the left side of the photo, see how “meta description” appears in Google search results.
You can also use a SEO plugin such as Yoast SEO, Rank Math or any other plugin. This would make it much easier for you, not only for meta description but also for other SEO aspects. But before using a SEO plugin you need to plan the entire structure of your site.