Title: Make generated %%excerpt%% length user-defined
Last modified: August 21, 2016

---

# Make generated %%excerpt%% length user-defined

 *  Anonymous User
 * (@anonymized-468039)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/make-generated-excerpt-length-user-defined/)
 * Around line 273 of wpseo-functions.php we can find this:
 * `'%%excerpt%%' => ( ! empty( $r->post_excerpt ) ) ? strip_tags( $r->post_excerpt):
   wp_html_excerpt( strip_shortcodes( $r->post_content ), 155),`
 * Please make this length (currently 155) user defined, so anyone can change this
   value.
    I’m getting better results using 200 to 300 chars long meta description
   and I have to change this manually on the php code each time I upgrade the plugin.
 * [https://wordpress.org/plugins/wordpress-seo/](https://wordpress.org/plugins/wordpress-seo/)

Viewing 1 replies (of 1 total)

 *  [Dmitry Bogdanov](https://wordpress.org/support/users/dbogdanov/)
 * (@dbogdanov)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/make-generated-excerpt-length-user-defined/#post-5018212)
 * for WP SEO by Yoast 2.0.1
    wordpress-seo/inc/class-wpseo-replace-vars.php if (!
   empty( $this->args->ID ) ) { if ( $this->args->post_excerpt !== ” ) { $replacement
   = strip_tags( $this->args->post_excerpt ); } elseif ( $this->args->post_content!
   == ” ) { $replacement = wp_html_excerpt( strip_shortcodes( $this->args->post_content),
   155 ); } }

Viewing 1 replies (of 1 total)

The topic ‘Make generated %%excerpt%% length user-defined’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Dmitry Bogdanov](https://wordpress.org/support/users/dbogdanov/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/make-generated-excerpt-length-user-defined/#post-5018212)
 * Status: not resolved