Try this: $caption_info = array(); add_filter( 'img_caption_shortcode', 'capture_caption', 10, 3 ); function capture_caption( $blank = '', $attr, $content ) { global $caption_info; $caption_info[] = array('attr' => $attr, 'content' => $content ); return ' '; } It will save info from all captions into global $caption_info variable and suppress their display in content (space is returned because filter result is ignored if empty). More Solution Help Creating a Slideshow Custom Post Type with Custom Meta Boxes? in WordPress backup - Which Blog Client for Windows/Linux has the best support for backing/restoring your posts? in WordPress plugin development - Admin config screen without menu in WordPress Can a user spread virus on my Multisite? in WordPress customization - updated permalink structure on localhost does not work in WordPress Reffered: https://wordpress.org/