• Resolved wooms

    (@wooms)


    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)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    By default, Yoast SEO doesn’t include the content from the excerpt input fields. If you’d like to include the content from the excerpt input fields, you’ll need to follow the guide here to create a custom implementation for this.

    Thread Starter wooms

    (@wooms)

    ALright, but what is the wpseo_post_content_for_recalculation filter for then?

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    According to tell pull request here, the relevant filter wpseo_post_content_for_recalculation was introduced to recalculate the SEO scores of posts. You can find more information about it on the relevant pull request.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to include post excerpt in content analysis’ is closed to new replies.