Want Auto-Generated Meta Descriptions without another bloated SEO Plugin?
We don’t need an SEO plugin for automatic meta descriptions. Once you have this going, include the following code into your theme’s header.php file (within the section: REMEMBER: to add the code opening and closing statements, so that the code does not break your site. For educational purposes, this broken code here, is being shown, so that the browser can interpret it like text. Hope this helps someone, since it sure helped this site 🙂
meta name="title" content="php echo get_the_title(); php"
meta name="description" content="php $content = get_the_content(); echo wp_trim_words( $content, 160, '...' );php"
meta name="DC.title" content="php echo get_the_title(); php"
meta name="DC.description" content="php $content = get_the_content(); echo wp_trim_words( $content, 160, '...' );php"
This custom code enables you to customize the descriptions for various types of pages, such as the home page, category pages, tag archives, and so on. Cheers!