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

I want to do this:

<a href="/wp-login"><span style="pointer-events:none">[shortcode]</span></a>

The Shortcode should be disabled but linked to a loginform.

but wordpress does this:

<a href="/wp-login"></a><span style="pointer-events:none"></span> [shortcode]    

The crazy thing is It worked a few days ago...

If you look here:


the "mitmachen" button is the shortcode and should link to loginform


After playing with some functions.php codes I found somewhere this is the output:

<a class="simplemodal-login" href="/beta/wp-login.php">
<span style="pointer-events:none">  </span>
<div class="textwidget">
<a class="read_more" href="http://www.manugoo.com/beta/kaninchenrasierer-4/">Mitmachen!</a>

I tried to insert other shortcodes which has no a-tag inside. Same result.

share|improve this question
What's the code for your shortcode handler? – TheDeadMedic Mar 12 '14 at 11:50
I would be glad to give you an aswer, but I don't know exactly what you want to here :) In final version the shortcode should do a gravity form – Martin Mar 12 '14 at 12:30
I've installed the Disable wpautop plugin. The result is that the span is wrapped around the shortcode when i don't put a link around. When I add a link output is like above. – Martin Mar 12 '14 at 12:39

Have you tried:

echo '<a href="/wp-login"></a><span style="pointer-events:none">';
echo do_shortcode( '[shortcode]' );
echo '</span></a>'; 

See: http://codex.wordpress.org/Function_Reference/do_shortcode

share|improve this answer
Thanks for reply. It works again. The shortcode I tried to wrap the a and span around had Ajax activated. After dissabling Ajax everything was fine. – Martin Mar 13 '14 at 17:21

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.