Title: Plugin conflicts with code to edit WordPress Excerpt Length
Last modified: December 19, 2019

---

# Plugin conflicts with code to edit WordPress Excerpt Length

 *  Resolved [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/)
 * Hi there, I have the WP Customer Area plugin, plus some paid add-ons installed
   on one of my websites. I have a piece of code in my theme’s functions.php file
   that adjusts the length of the post excerpt on the Archive pages:
 *     ```
       //Filter the except length to 80 characters.
       function mytheme_custom_excerpt_length( $length ) {
           return 80;
       }
       add_filter( 'excerpt_length', 'mytheme_custom_excerpt_length', 999 );
       ```
   
 * When I activate your plugin, this code no longer works.
 * Do you have any suggestions of an alternative code I can use to avoid this conflict,
   or a reason why your plugin affects wordpress excerpts?

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Contributor [Thomas](https://wordpress.org/support/users/tlartaud/)
 * (@tlartaud)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12333874)
 * Hi,
 * Does this happen in all pages of your site, or only on WPCA pages?
 * The only place where we are affecting the excerpt length is [https://gitlab.com/wp-customerarea/plugins/customer-area/blob/master/skins/frontend/master/cuar-functions.php#L223](https://gitlab.com/wp-customerarea/plugins/customer-area/blob/master/skins/frontend/master/cuar-functions.php#L223)
 * We only affect WPCA pages.
 * You can remove that by using this code so the excerpt length will be the same
   as the one used on your site.
 *     ```
       remove_filter( 'cuar_excerpt_length', 'cuar_custom_excerpt_length', 999);
       ```
   
 * Please, note that our support forums are located here: [https://wp-customerarea.com/support/](https://wp-customerarea.com/support/)
   
   You’ll get answers within 24 hours on this one (except on holidays & weekends
   of course).
 * Best regards.
 *  Thread Starter [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12334552)
 * This happens on all archive pages on the site, as long as the WPCA plugin is 
   activated.
 *  Plugin Contributor [Thomas](https://wordpress.org/support/users/tlartaud/)
 * (@tlartaud)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12337278)
 * What about the remove_filter code I Gave you? You can place it in your theme 
   functions.php file.
 * Regards.
 *  Thread Starter [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12347714)
 * Hi There, no adding that remove_filter code doesn’t sort the issue. When I activate
   your plugin, the exceprts still don’t honour my choice of length and also the‘
   Read More’ text becomes an elipsis (…).
 *  Plugin Contributor [Thomas](https://wordpress.org/support/users/tlartaud/)
 * (@tlartaud)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12381803)
 * Hi,
 * What if, for testing purposes, you manually remove the following function in `
   customer-area/skins/frontend/master/cuar-functions.php`?
 *     ```
       if ( ! function_exists( 'cuar_custom_excerpt_length' ) ) {
       	/**
       	 * Custom excerpt length
       	 *
       	 * @param $length
       	 *
       	 * @return int
       	 */
       	function cuar_custom_excerpt_length( $length )
       	{
       		if ( cuar_is_customer_area_page( get_queried_object() ) || cuar_is_customer_area_private_content( get_the_ID() ) ) {
       			return 30;
       		} else {
       			return $length;
       		}
       	}
   
       	add_filter( 'cuar_excerpt_length', 'cuar_custom_excerpt_length', 999 );
       }
       ```
   
 * Regards.
 *  Thread Starter [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12382224)
 * That didn’t work, but if a remove the code from lines 234 to 335, that DOES fix
   the issue!
 * It looks like the function cuar_remove_auto_excerpt is the issue.
 *  Plugin Contributor [Thomas](https://wordpress.org/support/users/tlartaud/)
 * (@tlartaud)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12392746)
 * Oh, nice catch.
 * In this case, try to add this to your theme `functions.php`.
    Not tried but it
   should work.
 *     ```
       remove_action( 'after_setup_theme', 'cuar_remove_auto_excerpt', 1000 );
       remove_filter( 'cuar_excerpt_length', 'cuar_custom_excerpt_length', 1000 );
       ```
   
 * Thank you for the report. I’ll check for the next updates if we need to make 
   some changes on this point.
 * Regards.
 *  Thread Starter [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12426187)
 * Unfortunately the above code added to my functions.php file did not fix the issue.
   The only way it works seems to be manually removing the code from the plugin 
   files.
 *  Thread Starter [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12445586)
 * I’ve just noticed some interesting behaviour. When I change a post to use Siteorigin
   Page Builder, rather than the regular editor, the Excerpt length and ‘Read More’
   text work properly again! So this bug only affects pages using the regular wordpress
   editor. Not tested with Guttenberg as I don’t use that.
 *  Plugin Contributor [Thomas](https://wordpress.org/support/users/tlartaud/)
 * (@tlartaud)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12460826)
 * Hi,
 * I have published a new release.
 * I have edited our actual code so the excerpts of your site will only be affected
   on WP Customer Area pages & posts.
 * I hope that this will fix your issue.
 * Regards.
 *  Thread Starter [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12464005)
 * I’ve updated the plugin and it does indeed seem to have sorted the issue! Many
   thanks.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Plugin conflicts with code to edit WordPress Excerpt Length’ is closed
to new replies.

 * ![](https://ps.w.org/customer-area/assets/icon-256x256.png?rev=1288039)
 * [WP Customer Area](https://wordpress.org/plugins/customer-area/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/customer-area/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/customer-area/)
 * [Active Topics](https://wordpress.org/support/plugin/customer-area/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/customer-area/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/customer-area/reviews/)

## Tags

 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [length](https://wordpress.org/support/topic-tag/length/)

 * 11 replies
 * 2 participants
 * Last reply from: [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/plugin-conflicts-with-code-to-edit-wordpress-excerpt-length/#post-12464005)
 * Status: resolved