How to get the unfiltered excerpt, without […] or auto-excerpting

Why don’t you use the global $post variable? It contains an object with the content as it is on the db row corresponding to that post. Here’s how to use it:

global $post; // If for some reason it's readily accessible, invoke it
if($post->post_excerpt != '') {
    echo($post->post_excerpt);
}

Or:

$my_post = get_post($post_id);
if($my_post->post_excerpt != '') {
    echo($my_post->post_excerpt);
}

Very simple, but let us know if you’re having trouble getting it working.

Leave a Comment