WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top




<a href="foobar">[title]</a>

Wordpress shortcode API sais, it's correct:


Any Ideas?

share|improve this question
up vote 5 down vote accepted

From the page you linked:

The shortcode parser correctly deals with nested shortcode macros, provided their handler functions support it by recursively calling do_shortcode():

You need to recursively call do_shortcode() on any shortcode handler that could contain nested shortcodes. So for example:

function wpse18659_permalink( $atts, $content ){
    return '<a href="' . get_permalink() . '" title="Permalink to ' . get_the_title() . '" alt="">' . do_shortcode( $content ) . '</a>';

add_shortcode( 'permalink', 'wpse18659_permalink' );

That should handle nested shortcodes just fine.

share|improve this answer
This one will help me a lot! Upvoted ;) – Kaaviar Jun 7 '11 at 8:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.