Title: Count shortcode output &amp; cache result
Last modified: September 16, 2020

---

# Count shortcode output & cache result

 *  [WPExplorer](https://wordpress.org/support/users/wpexplorer/)
 * (@wpexplorer)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/count-shortcode-output-cache-result/)
 * First of all, great plugin!
 * Wouldn’t it make more sense to count the words output by shortcodes since there
   are page builders out there that actually have text blocks.
 * My recommendation would be to generate the full output of the content by applying
   the_content filter than counting the words. We could save the count in a meta
   value and clear it whenever the post is saved so we can cache the value of rt_calculate_reading_time
   to further optimize things.
 * – AJ

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jason Yingling](https://wordpress.org/support/users/yingling017/)
 * (@yingling017)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/count-shortcode-output-cache-result/#post-13421037)
 * Originally my concern with shortcodes was around not knowing what they would 
   output, but as the plugin has evolved it may be worth it to revisit that. Since
   we could render the shortcodes and strip out the markup generated with `wp_strip_all_tags`.
 * Storing something in postmeta is something on the feature list too when I get
   some time to rework the plugin.

Viewing 1 replies (of 1 total)

The topic ‘Count shortcode output & cache result’ is closed to new replies.

 * ![](https://ps.w.org/reading-time-wp/assets/icon-256x256.png?rev=2355751)
 * [Reading Time WP](https://wordpress.org/plugins/reading-time-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/reading-time-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/reading-time-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/reading-time-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/reading-time-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/reading-time-wp/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jason Yingling](https://wordpress.org/support/users/yingling017/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/count-shortcode-output-cache-result/#post-13421037)
 * Status: not a support question