Title: pass URL param into shortcode
Last modified: August 31, 2016

---

# pass URL param into shortcode

 *  [benreneke](https://wordpress.org/support/users/benreneke/)
 * (@benreneke)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/pass-url-param-into-shortcode/)
 * Hi,
    Thanks for making this plugin!
 * I want to know if there is a way to insert URL param into shortcode using your
   plugin?
 * In my case, i give a link to my client:
    [https://mywebsite.fr/mypage?myurlparam=value](https://mywebsite.fr/mypage?myurlparam=value)
 * I want to insert the “value” of “myurlparam” into “myshortcode”, something like:
 *     ```
       [insert_php]
       echo do_shortcode('[myshortcode att="'.$_POST[myurlparam].'"]');
       [/insert_php]
       ```
   
 * An idea? is it possible with your plugin? i’m noobie in code…
 * Thx for help!
 * [https://wordpress.org/plugins/insert-php/](https://wordpress.org/plugins/insert-php/)

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

 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/pass-url-param-into-shortcode/#post-7409945)
 * benreneke, values in URLs are $_GET values instead of $_POST values.
 * Whether or not the GET parameter survives depends on your Permalink Settings.
   The available $_GET values can be displayed like this:
 *     ```
       <pre>
       [insert_php]
       echo print_r($_GET,true);
       [/insert_php]
       </pre>
       ```
   
 * When you know what’s available, you know what you can use.
 * I’m uncertain what the do_shortcode() function is supposed to do. It might or
   might not be compatible with Insert PHP.
 * (Although it looks like it, [insert_php]…[/insert_php] is not a shortcode. Instead,
   they are placeholders for PHP code for the plugin to run.)
 * [http://php.net/search.php](http://php.net/search.php) is a good reference for
   PHP functions.
 * [http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php](http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php)
   is a good reference for Insert PHP.
 * Will
 *  Thread Starter [benreneke](https://wordpress.org/support/users/benreneke/)
 * (@benreneke)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/pass-url-param-into-shortcode/#post-7409976)
 * It works for me!
 *     ```
       [insert_php]
       echo do_shortcode('[myshortcode att="'.$_GET[myurlparam].'"]');
       [/insert_php]
       ```
   
 * Thx a lot for your reactivity!

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

The topic ‘pass URL param into shortcode’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3475630)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [benreneke](https://wordpress.org/support/users/benreneke/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/pass-url-param-into-shortcode/#post-7409976)
 * Status: not resolved