Title: closing shortcode [/code] not supported?
Last modified: December 6, 2017

---

# closing shortcode [/code] not supported?

 *  Resolved [frizzel](https://wordpress.org/support/users/frizzel/)
 * (@frizzel)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/closing-shortcode-code-not-supported/)
 * I’m trying to put content sections between shortcode tags of plug-in [Mobile Detect](https://wordpress.org/plugins/wp-mobile-detect/),
   e.g. [notdevice]_The content section is here_[/notdevice]. However, the ‘shortcode
   widget’ seems to support the opening shortcode only, not the closing one. The
   opening shortcode is not displayed on the page (so that seems to be recognised),
   but the closing shortcode is displayed as just the code. Mind you, I’m trying
   to put **sections** between them, the shortcodes of course do work within one
   text block.
 * I know Elementor has the ability to ‘not show’ a section on chosen devices, but
   that only adds ‘display:none’ to the CSS. I want the section to not load at all,
   which is what the plug-in does.

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

 *  [benpines](https://wordpress.org/support/users/benpines/)
 * (@benpines)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/closing-shortcode-code-not-supported/#post-9759960)
 * Hi Frizzel,
    The shortcode tags you mentioned have not been designed to hide 
   Elementor sections and that’s why they don’t work.
 *  Thread Starter [frizzel](https://wordpress.org/support/users/frizzel/)
 * (@frizzel)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/closing-shortcode-code-not-supported/#post-9760666)
 * ??? The shortcode tags I mentioned **ARE** designed to not just ‘hide’ but instead‘
   not load’ content in between. What you are saying is that Elementor does not 
   support this (at least the [/close] tag). That’s a big difference, and to be 
   honest quite an unsatisfactory answer.
 * But, as a suggestion: why not have the Elementor option of hiding a section make
   it ‘do not load this section’ instead of ‘display:none’? I mean, if you want 
   to hide it, you obviously don’t want to load it.
    -  This reply was modified 8 years, 5 months ago by [frizzel](https://wordpress.org/support/users/frizzel/).
 *  [pingram](https://wordpress.org/support/users/pingram3541/)
 * (@pingram3541)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/closing-shortcode-code-not-supported/#post-9761176)
 * [@frizzel](https://wordpress.org/support/users/frizzel/) I don’t think you understand
   the underlying code and how Elementor is rendered which is different than wp_content
   that those shortcode wrappers would have an effect upon. But I understand your
   frustration and what you are intending to do.
 * I also had to devise a way for the Paid Memberships Pro free membership plugin
   to also allow disabling of showing (and loading) of Elementor designed content
   otherwise a sign-up/login message was provided on member-only post/products/pages.
   Here is the example – [https://gist.github.com/pingram3541/831aecf628165b5f36f856303b23b5be](https://gist.github.com/pingram3541/831aecf628165b5f36f856303b23b5be)
 * Alternatively you could approach the shortcode author and ask them kindly to 
   consider reading this thread and modifying their plugin to also recognize Elementor
   content in some fashion, maybe by adding a special class to a section, column
   or element will hide it as per your needs.
 * Best of luck and success to you!
 * [edit] I felt I should add just a small opinion about plugin adaptation. I personally
   feel it is more logical for the feature plugin such as shortcodes and widgets
   and the like, more appropriately adapt their code to support the small number
   of popular page builder plugins vs the other way around. It reduces everybody’s
   support efforts and envelops trusted plugin groups when developers know they 
   all work together, they will continue using them together on a greater number
   of sites they build. On the flip, it would be an impossible task for Elementor
   to adapt to the bajillion feature plugins that exist out there not to mention
   the 50k here @ wordpress.org.
    -  This reply was modified 8 years, 5 months ago by [pingram](https://wordpress.org/support/users/pingram3541/).
 *  [pingram](https://wordpress.org/support/users/pingram3541/)
 * (@pingram3541)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/closing-shortcode-code-not-supported/#post-9761433)
 * A better and simpler example than above (which would modify core and may not 
   even be up to date) – this one is also for Paid Memberships Pro but is easily
   added to a theme’s functions.php, you could dissect and mutate as needed for 
   your purposes – [https://gist.github.com/matipojo/2a56dcf482a3ab9482610a93653c1116](https://gist.github.com/matipojo/2a56dcf482a3ab9482610a93653c1116)
 *  Thread Starter [frizzel](https://wordpress.org/support/users/frizzel/)
 * (@frizzel)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/closing-shortcode-code-not-supported/#post-9762473)
 * [@philip](https://wordpress.org/support/users/philip/) Ah yes, I see what you
   mean by the plugin targeting wp_content which indeed wouldn’t work with Elementor.
   I understand what you are doing in supplied code. However, the section blocks
   I wanted to not load have varying content. So, I decided to save them as Elementor
   templates and then conditionally call them in the post type template used.
 * Thank you for your help and suggestions.

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

The topic ‘closing shortcode [/code] not supported?’ is closed to new replies.

 * ![](https://ps.w.org/elementor/assets/icon-256x256.gif?rev=3444228)
 * [Elementor Website Builder - more than just a page builder](https://wordpress.org/plugins/elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elementor/reviews/)

## Tags

 * [mobile detect](https://wordpress.org/support/topic-tag/mobile-detect/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 5 replies
 * 3 participants
 * Last reply from: [frizzel](https://wordpress.org/support/users/frizzel/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/closing-shortcode-code-not-supported/#post-9762473)
 * Status: resolved