Title: Problem with Description
Last modified: August 21, 2016

---

# Problem with Description

 *  Resolved [stephen_connolly](https://wordpress.org/support/users/stephen_connolly/)
 * (@stephen_connolly)
 * [12 years ago](https://wordpress.org/support/topic/problem-with-description/)
 * Hello,
 * I have the following hook setup in my theme’s functions.php:
 *     ```
       function _jm_tc_strip_tags($content) {
       	return strip_tags($content);
       }
       add_filter('jm_tc_get_excerpt', '_jm_tc_strip_tags');
       ```
   
 * But this funtion is not being called. I based this solution from the following
   thread:
 * [http://wordpress.org/support/topic/problems-with-twitter-description-meta-name](http://wordpress.org/support/topic/problems-with-twitter-description-meta-name)
 * regards
 * [https://wordpress.org/plugins/jm-twitter-cards/](https://wordpress.org/plugins/jm-twitter-cards/)

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

 *  Anonymous User 10765487
 * (@anonymized-10765487)
 * [12 years ago](https://wordpress.org/support/topic/problem-with-description/#post-4763727)
 * There’s already a `wp_strip_all_tags()` in `wp_trim_words()`, no use to add your
   strip tags
 *  Thread Starter [stephen_connolly](https://wordpress.org/support/users/stephen_connolly/)
 * (@stephen_connolly)
 * [12 years ago](https://wordpress.org/support/topic/problem-with-description/#post-4763730)
 * Ok, thanks,
 * I’ve just tried adding a filter (in my theme’s funtions.php) as follows:
 * `add_filter('jm_tc_get_excerpt', 'wp_strip_all_tags($content)');`
 * and I tried:
 * `add_filter('jm_tc_get_excerpt', 'wp_strip_all_tags()');`
 * but filter is not being called.
 * Any thought ?
 *  Anonymous User 10765487
 * (@anonymized-10765487)
 * [12 years ago](https://wordpress.org/support/topic/problem-with-description/#post-4763732)
 * It’s already implemented in plugin because I use wp_trim_words() for the excerpt.
 * Filters do not work that way in WP. You’d better do something like this:
 *     ```
       add_filter('jm_tc_get_excerpt', '_strip_my_tags');
       function _strip_my_tags( $content ) {
         return wp_strip_all_tags($content);
       }
       ```
   
 * But as I said it’s already in the plugin (with the latest version)
 *  Thread Starter [stephen_connolly](https://wordpress.org/support/users/stephen_connolly/)
 * (@stephen_connolly)
 * [12 years ago](https://wordpress.org/support/topic/problem-with-description/#post-4763738)
 * Form some reason the function _strip_my_tags is not being executed, from my functions.
   php script in my theme’s folder.
 * Anyway, I got around the problem by making the following change in jm-twitter-
   card.php:
 * `$output .= '<meta name="twitter:description" content="' . jm_tc_remove_lb( wp_strip_all_tags(
   $cardDescription) ) . '"/>' . "\n";`
 * Not ideal but works.
 * Thanks for the help.

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

The topic ‘Problem with Description’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jm-twitter-cards.svg)
 * [JM Twitter Cards](https://wordpress.org/plugins/jm-twitter-cards/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jm-twitter-cards/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jm-twitter-cards/)
 * [Active Topics](https://wordpress.org/support/plugin/jm-twitter-cards/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jm-twitter-cards/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jm-twitter-cards/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [stephen_connolly](https://wordpress.org/support/users/stephen_connolly/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/problem-with-description/#post-4763738)
 * Status: resolved