Meta Description Tag

The meta description tag is automatically generated from the post/page excerpt or post/page content (in case you don’t enter an excerpt).

Note that WordPress doesn’t support excerpt for pages. Slim SEO fixes this by adding excerpt to pages, so you can enter custom excerpt for pages.

  • For homepage, if you set it as a static page, then the plugin treats it like a normal page.
  • For categories, post tags or custom taxonomies, their description will be used as meta description.

The meta description will be normalized by stripping all the HTML tags, white spaces. The plugin also parses shortcodes (in case you use shortcodes in the post content or use a page builder plugin to build your page). Finally, the description will be truncated to 60 words (approximately 300 characters), as recommended by Google.

How to change the meta description?

If you want to change the meta description, please use the slim_seo_meta_description filter.

The following code change the description of a post with ID = 24. The description is set via a custom field:

add_filter( 'slim_seo_meta_description', function ( $description ) {
if ( is_single( 24 ) ) {
$description = get_post_meta( get_the_ID(), 'field_id', true );
return $description;
} );