Title: Developer Challenge: Nested Shortcode of Same Instance
Last modified: August 22, 2016

---

# Developer Challenge: Nested Shortcode of Same Instance

 *  [pingram](https://wordpress.org/support/users/pingram3541/)
 * (@pingram3541)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/developer-challenge-nested-shortcode-of-same-instance/)
 * Hi all, I’m sure many of you are aware of the infamous restriction in wordpress
   shortcodes where nesting a shortcode of the same name is unsupported. This is
   becoming increasingly undesirable as theme developers include “front end” designer-
   like tools such as Visual Composer.
 * I’ve seen countless threads where developers would love to give their clients
   more control over the design structure of their content directly within a page/
   post without having to write html that *could* and *often* becomes molested by
   the core’s filtering, i.e. extra p tags, removal of classes and empty elements
   such a span tags used for icons, etc. For example, I personally would love to
   give my clients the ability to build semantic html directly within the editor
   using a visual tool taking advantage of a form driven approach.
 * So I have a challenge. The thought occurred to me, there must be a way around
   this WITHOUT hacking the core. However, my personal strengths are css and js,
   not so much php even though I have written my fair share of themes and plugins.
 * One thought, is to somehow extend the core “do_shortcode” function. This thread
   suggest hacking the core however, I really don;t know if its possible to “extend”
   this from a plugin or theme functions.php since its not a class. [http://wordpress.stackexchange.com/questions/70290/does-wordpress-support-a-shortcode-calling-itself-from-within-a-shortcode-call](http://wordpress.stackexchange.com/questions/70290/does-wordpress-support-a-shortcode-calling-itself-from-within-a-shortcode-call)
 * Another thought but not sure if this is possible either is to use a filter against
   the “name” of the shortcode along with a unique trailing id so a shortcode with
   the same name is never actually nested within itself. For example, if I wrote
   a shortcode such as [section][/section], and somehow we tell wordpress that any[
   section_*][/section_*] (where _* is any unique id such as a timestamp) renders
   using the defined [section] shortcode. Is this possible?
 * If you think so, let the challenge begin and most importantly, have fun =)

The topic ‘Developer Challenge: Nested Shortcode of Same Instance’ is closed to 
new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [pingram](https://wordpress.org/support/users/pingram3541/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/developer-challenge-nested-shortcode-of-same-instance/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
