Title: Link generated with shortcode issue&#8230;
Last modified: October 4, 2023

---

# Link generated with shortcode issue…

 *  Resolved [VERYA Inc.](https://wordpress.org/support/users/veryaca/)
 * (@veryaca)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/link-generated-with-shortcode-issue/)
 * Hi!
 * When using the **Button Group** widget, and using a shortcode as the link, it
   seems like some encoding occurs and prevents WP from functioning properly. Let
   me explain.
 * My custom shortcode returns a URL, that I build dynamically with `add_query_arg`.
   If there is only one argument, it’s fine. But my URL has 2 arguments. The code
   is similar to this:
 *     ```wp-block-code
       $url = add_query_arg(array(
         'type' => 'tmp',
         'slid' => get_the_ID()
       ), get_permalink(1111));
   
       return $url;
       ```
   
 * For some reason, when I’m using the shortcode with your **Button Group** widget,
   the URL I’m getting is this:
 * _[https://dev.com/?type=tmp<span](https://dev.com/?type=tmp<span) style=”text-
   decoration: underline;”>&amp;</span>slid=364_
 * But I should be getting this (note the `&` not being encoded):
 * _[https://dev.com/?type=tmp<span](https://dev.com/?type=tmp<span) style=”text-
   decoration: underline;”>&</span>slid=364_
 * When using that same shortcode on an Elementor basic button, it’s working fine.
   Even as a plain shortcode I’m getting the right URL. That’s why I’m leaning toward
   a manipulation from your plugin. Are you guys using `htmlentities` before rendering
   the link?
 * That being said, normally I wouldn’t care much. But using `get_query_var` is 
   not working if the `&` is encoded as `&amp;`.
 * Please advise 🙂
    -  This topic was modified 2 years, 7 months ago by [VERYA Inc.](https://wordpress.org/support/users/veryaca/).

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

 *  Plugin Author [Unlimited Elements](https://wordpress.org/support/users/unitecms/)
 * (@unitecms)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/link-generated-with-shortcode-issue/#post-17125793)
 * please open a ticket on our official website with your query .
 *  Thread Starter [VERYA Inc.](https://wordpress.org/support/users/veryaca/)
 * (@veryaca)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/link-generated-with-shortcode-issue/#post-17126723)
 * Thanks, but no thanks. After almost 2 weeks, I uninstalled the plugin and found
   a better solution.

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

The topic ‘Link generated with shortcode issue…’ is closed to new replies.

 * ![](https://ps.w.org/unlimited-elements-for-elementor/assets/icon-256x256.gif?
   rev=3429497)
 * [Unlimited Elements For Elementor](https://wordpress.org/plugins/unlimited-elements-for-elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/unlimited-elements-for-elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/unlimited-elements-for-elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/unlimited-elements-for-elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/unlimited-elements-for-elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/unlimited-elements-for-elementor/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [VERYA Inc.](https://wordpress.org/support/users/veryaca/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/link-generated-with-shortcode-issue/#post-17126723)
 * Status: resolved