Title: urlencode from shortcode?
Last modified: August 20, 2016

---

# urlencode from shortcode?

 *  [jonathanwilke](https://wordpress.org/support/users/doubleyoumusic/)
 * (@doubleyoumusic)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/urlencode-from-shortcode/)
 * Hi guys,
 * when I try to encode a url with urlencode wich was given by the content parameter
   of a shortcode, than it get’s encoded wrong. Here’s the code:
 * `function OEreturnData($atts,$content=null){
    extract(shortcode_atts(array( '
   maxwidth' => 500, 'maxheight' => 281, ), $atts)); var_dump(urlencode($content));}
 * add_shortcode('shortcode_name', 'OEreturnData');
 * And for example with this value
 * `[shortcode_name]http://herthabsc.de/index.php?id=3631&tx_ttnews[tt_news]=13144&
   cHash=9ef2e9ee006fb16188ebf764232a0ba9[/shortcode_name]`
 * I get the return of
 * `http%3A%2F%2Fherthabsc.de%2Findex.php%3Fid%3D3631%26%23038%3Btx_ttnews%5Btt_news%
   5D%3D13144%26%23038%3BcHash%3D9ef2e9ee006fb16188ebf764232a0ba9`
 * But it actually should be
 * `http%3A%2F%2Fherthabsc.de%2Findex.php%3Fid%3D3631%26tx_ttnews%5Btt_news%5D%3D13144%
   26cHash%3D9ef2e9ee006fb16188ebf764232a0ba9%20%20`
 * What’s the problem?

The topic ‘urlencode from shortcode?’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [jonathanwilke](https://wordpress.org/support/users/doubleyoumusic/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/urlencode-from-shortcode/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
