How to include post excerpt in content analysis
-
In our theme, the post excerpt is used as the introductory content for the posts. We want to include this content in the content analysis, as this does not seem to be the case at first.
We’ve tried using the following filter to prepend the post excerpt to the post content, but it does not seem to work for the content analysis.
function filter_wpseo_post_content_for_recalculation( $content, $item ) { $summary = $item->post_excerpt; return $summary . PHP_EOL . $content; } add_filter( 'wpseo_post_content_for_recalculation', 'filter_wpseo_post_content_for_recalculation', 10, 2 );
What is the preferred way of including the post excerpt in the content analysis?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to include post excerpt in content analysis’ is closed to new replies.