Title: Jetpack processes shortcodes twice?
Last modified: August 20, 2016

---

# Jetpack processes shortcodes twice?

 *  Resolved [zingiri](https://wordpress.org/support/users/zingiri/)
 * (@zingiri)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/)
 * It seems that after activating Jetpack, WP shortcodes are processed twice. Once
   as part of the wp_head() execution (unexpected) and once in the loop (as expected).
   
   I suspect this is because of an additional do_shortcode() call in one of the 
   Jetpack actions. Can this be resolved or is there a way to avoid shortcodes to
   be triggered inside the header?
 * [http://wordpress.org/extend/plugins/jetpack/](http://wordpress.org/extend/plugins/jetpack/)

Viewing 15 replies - 1 through 15 (of 32 total)

1 [2](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/page/2/?output_format=md)

 *  Plugin Contributor [Tim Moore](https://wordpress.org/support/users/tmoorewp/)
 * (@tmoorewp)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362140)
 * Can you provide an example of where this is happening?
 * Also, is there a specific plugin that this happens with?
 *  Thread Starter [zingiri](https://wordpress.org/support/users/zingiri/)
 * (@zingiri)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362167)
 * It’s been happening with one of our plugins, the Bookings plugin and reported
   by a couple of our users.
    It can be replicated with the following code:
 *     ```
       add_shortcode( 'bookings', 'bookings_shortcode' );
       function bookings_shortcode( $atts, $content=null, $code="" ) {
       return 'test';
       }
       ```
   
 * In this case ‘test’ will be output in the header and on the page.
    Note that 
   the above is an abreviated version of the code used in the Bookings plugin.
 *  Plugin Contributor [Tim Moore](https://wordpress.org/support/users/tmoorewp/)
 * (@tmoorewp)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362175)
 * Thanks for the info; we are looking into this issue.
 *  Plugin Contributor [Tim Moore](https://wordpress.org/support/users/tmoorewp/)
 * (@tmoorewp)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362182)
 * I’m unable to reproduce this using Jetpack 2.1.1 and latest WordPress.
 * Are you by chance using `get_the_excerpt` or `get_the_content` or `the_excerpt`
   or `the_content` actions in your plugin?
 *  Thread Starter [zingiri](https://wordpress.org/support/users/zingiri/)
 * (@zingiri)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362188)
 * No, not using any of those. Maybe it’s caused by a combination of Jetpack with
   another plugin. The person who reported the issue managed to resolve it by disabling
   Jetpack.
 *  Plugin Contributor [Tim Moore](https://wordpress.org/support/users/tmoorewp/)
 * (@tmoorewp)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362193)
 * It’s possible. If you want to have the person who reported the issue contact 
   us directly, our email address is [support@jetpack.me](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/support@jetpack.me?output_format=md).
   We’d be happy to help resolve this and get whatever fix in place that is necessary.
   I just need some more debugging info to go in first 🙂
 * Thanks!
 *  Thread Starter [zingiri](https://wordpress.org/support/users/zingiri/)
 * (@zingiri)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362194)
 * OK, thanks for your help so far. I will let the person know.
 *  [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * (@davidanderson)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362375)
 * I have this problem too. I placed a PHP warning and got a stack trace. Here’s
   how JetPack is calling the shortcode:
 * PHP Stack trace:
    PHP 1. {main}() /mywebsite/index.php:0 PHP 2. require() /mywebsite/
   index.php:17 PHP 3. require_once() /mywebsite/wp-blog-header.php:16 PHP 4. include()/
   mywebsite/wp-includes/template-loader.php:43 PHP 5. get_header() /mywebsite/wp-
   content/themes/cloudhost-parent/page.php:4 PHP 6. locate_template() /mywebsite/
   wp-includes/general-template.php:34 PHP 7. load_template() /mywebsite/wp-includes/
   template.php:366 PHP 8. require_once() /mywebsite/wp-includes/template.php:390
   PHP 9. wp_head() /mywebsite/wp-content/themes/cloudhost-child/header.php:33 PHP
   10. do_action() /mywebsite/wp-includes/general-template.php:1576 PHP 11. call_user_func_array()/
   mywebsite/wp-includes/plugin.php:403 PHP 12. jetpack_og_tags() /mywebsite/wp-
   includes/plugin.php:403 PHP 13. jetpack_og_get_image() /mywebsite/wp-content/
   plugins/jetpack/functions.opengraph.php:71 PHP 14. Jetpack_PostImages::get_images()/
   mywebsite/wp-content/plugins/jetpack/functions.opengraph.php:109 PHP 15. Jetpack_PostImages::
   from_html() /mywebsite/wp-content/plugins/jetpack/class.jetpack-post-images.php:
   407 PHP 16. apply_filters() /mywebsite/wp-content/plugins/jetpack/class.jetpack-
   post-images.php:254 PHP 17. call_user_func_array() /mywebsite/wp-includes/plugin.
   php:170 PHP 18. do_shortcode() /mywebsite/wp-includes/plugin.php:170
 * The shortcode then gets called a second time in the ordinary way:
 * PHP Stack trace:
    PHP 1. {main}() /mywebsite/index.php:0 PHP 2. require() /mywebsite/
   index.php:17 PHP 3. require_once() /mywebsite/wp-blog-header.php:16 PHP 4. include()/
   mywebsite/wp-includes/template-loader.php:43 PHP 2. require() /mywebsite/index.
   php:17 PHP 3. require_once() /mywebsite/wp-blog-header.php:16 PHP 4. include()/
   mywebsite/wp-includes/template-loader.php:43 PHP 5. the_content() /mywebsite/
   wp-content/themes/cloudhost-parent/page.php:26 PHP 6. apply_filters() /mywebsite/
   wp-includes/post-template.php:166 PHP 6. apply_filters() /mywebsite/wp-includes/
   post-template.php:166 PHP 7. call_user_func_array() /mywebsite/wp-includes/plugin.
   php:170 PHP 8. do_shortcode() /mywebsite/wp-includes/plugin.php:170
 * This caused me a big problem, as the shortcode was processing _POST parameters–
   twice.
 *  [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * (@davidanderson)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362377)
 * P.S. Disabling Photonic only (not the rest of JetPack) removed the double-call.
 *  [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * (@davidanderson)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362378)
 * I spoke too soon – the error has returned, even whilst Photonic is off.
 *  Thread Starter [zingiri](https://wordpress.org/support/users/zingiri/)
 * (@zingiri)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362380)
 * Thanks David, hopefully this gives Tim more info in order to resolve the issue.
 *  [Manoj Chacko](https://wordpress.org/support/users/mjc82in/)
 * (@mjc82in)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362393)
 * Is there any updates on this. I have this problem on my live site. Is their a
   temporary work around, other than disabling it?
 *  Plugin Contributor [Tim Moore](https://wordpress.org/support/users/tmoorewp/)
 * (@tmoorewp)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362398)
 * I’ll take a look at this and get a fix out as soon as I can.
 *  [bobbyl76](https://wordpress.org/support/users/bobbyl76/)
 * (@bobbyl76)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362406)
 * This is also happening to a theme forest theme I’m using called Natural. The 
   galleria shortcode is broken by this same issue. I hope you guys find a workaround
   quickly. I want to use both Jetpack and galleria.
 * [http://www.bobbylopezcreative.com/port/](http://www.bobbylopezcreative.com/port/)
 *  [smartypants](https://wordpress.org/support/users/smartypants/)
 * (@smartypants)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/#post-3362407)
 * Confirmed this happening with my plugin sp client document manager plugin as 
   well. It seems to be running the shortcode once before the document and once 
   again in the document.

Viewing 15 replies - 1 through 15 (of 32 total)

1 [2](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/page/2/?output_format=md)

The topic ‘Jetpack processes shortcodes twice?’ is closed to new replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

 * 32 replies
 * 7 participants
 * Last reply from: [zingiri](https://wordpress.org/support/users/zingiri/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/jetpack-processes-shortcodes-twice/page/3/#post-3362460)
 * Status: resolved