How to Fix Excerpt Length Not Working in Elementor

Updated: October 8, 2022

Elementor Pro comes with a Posts widget that allows you to display the posts on your website by a certain query. There are lots of settings you can set when working with the Posts widget, including the excerpt length. There is a common issue regarding the excerpt length in Elementor. In some cases, the excerpt length setting not working when the page has been published (or previewed), even if the excerpt length has been set.

For instance, you have set the excerpt length to 15. This means, the excerpt length of each post supposed to 15 words.

In reality — once the page is published or previewed — the excerpt length is longer than that (more than 15 words).

We are not sure whether this is a serious bug or not, but it doesn’t happen to all WordPress themes. If you use Elementor’s Hello theme or WordPress’ default themes, you might don’t experience the same issue. The issue usually happens on WordPress themes that have an option to set the excerpt length (not all WordPress themes offer an option set the excerpt length).

So, if you are experiencing the issue of the excerpt length setting not working when working with the Posts widget in Elementor, while you have set it, you can go to the WordPress theme customizer (Appearance -> Customize) to fix the problem. The setting location to set the excerpt length might be vary depending on the theme you use. On the Agency Plus theme, you can go to Theme Options -> Blog/Archive.

This page may contain affiliate links, which help support WP Pagebuilders. Learn more

4 thoughts on “How to Fix Excerpt Length Not Working in Elementor”

  1. I’ve made all the changes you suggested, but still can’t get Elementor to show excerpts on my site – the preview is perfect as well as mobile views – but the desktop page looks AWFUL!

    https://www. melodyhogan.com/blog

    Any thoughts for a work-around?

    Reply
  2. This is my solution, maybe help someone:
    image

    function summary($content, $limit = 200) {
    $content = strip_tags($content);
    // Take the existing content and return a subset of it
    $end = ”;
    if (strlen($content) > $limit) {
    $end = ‘…’;
    }
    return substr($content, 0, $limit) . $end;
    }

    add_action( ‘elementor_pro/posts/query/custom_excerpt’, function( $query ) {

    function trimTitle( $text, $id = null ) {
    return summary($text,80);
    }

    function trimExcerpt( $text, $id = null ) {
    return wpautop(summary($text,110));
    }

    add_filter( ‘the_title’, ‘trimTitle’, 10, 2 );
    add_filter( ‘the_excerpt’, ‘trimExcerpt’, 10, 2 );

    } );

    Reply

Leave a Comment

Pin It on Pinterest

Thanks for commenting

Help us grow by sharing this post with your friends!

Join 1,000+ WordPress users receiving tips and insights on creating on WordPress with Elementor.

Creating with WordPress?​

Subscribe and join 1,000+ WordPress users receiving tips and insights on creating with WordPress in the no-code era. At WP Pagebuilders, we write about the following topics a lot.